Use SSIZE_MAX for overflow check in parseoffset()
There's no such thing as OFF_MAX so we can't use that. off_t is signed, so use SSIZE_MAX which will typically match the range of off_t.
This commit is contained in:
parent
1be832320c
commit
67157b7c4e
@ -52,7 +52,7 @@ parseoffset(const char *str)
|
||||
}
|
||||
|
||||
/* prevent overflow */
|
||||
if (res > (SIZE_MAX / scale)) {
|
||||
if (res > (SSIZE_MAX / scale)) {
|
||||
weprintf("parseoffset %s: out of range\n", str);
|
||||
return -1;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user