diff options
| author | Leah Rowe <leah@libreboot.org> | 2026-03-23 08:30:19 +0000 |
|---|---|---|
| committer | Leah Rowe <leah@libreboot.org> | 2026-03-23 08:31:41 +0000 |
| commit | 024862a1523c7c8ed6d812b1dc4ed4ecd23d413f (patch) | |
| tree | 04a6e55a7fbba6bc8aae396f46c692f1fc042568 | |
| parent | c1c1aee6955fe94b1a3f1d8b2b9e065f26ab5fdf (diff) | |
mkhtemp: fix bad check
where the path is quite short and the number of X
is quite big compared to the rest of it, this
check will actually cause a false overflow
error. the maths are correct, just not the error
Signed-off-by: Leah Rowe <leah@libreboot.org>
| -rw-r--r-- | util/nvmutil/lib/file.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/util/nvmutil/lib/file.c b/util/nvmutil/lib/file.c index e8dfd865..30694623 100644 --- a/util/nvmutil/lib/file.c +++ b/util/nvmutil/lib/file.c @@ -842,8 +842,7 @@ mkhtemp(int *fd, return -1; } - if (fname_len > len || - fname_len > (len - xc)) { + if (fname_len > len) { errno = EOVERFLOW; return -1; } |
