commit 67157b7c4ea433f3a8dcbdfb5dbbc21108268852
Author: sin <[email protected]>
AuthorDate: Thu Nov 26 10:30:35 2015 +0000
Commit: sin <[email protected]>
CommitDate: Thu Nov 26 10:35:46 2015 +0000
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.
diff --git a/libutil/parseoffset.c b/libutil/parseoffset.c
index 37673da..362a782 100644
--- a/libutil/parseoffset.c
+++ b/libutil/parseoffset.c
@@ -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;
}