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>
This commit is contained in:
Leah Rowe
2026-03-23 08:30:19 +00:00
parent c1c1aee695
commit 024862a152

View File

@@ -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;
}