mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-27 05:21:08 +01:00
Fix bug parsing 32 bit integers on machines where sizeof(long) == 4.
This commit is contained in:
parent
9300c69625
commit
2076235ada
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=54094
@ -465,7 +465,8 @@ ng_int32_parse(const struct ng_parse_type *type,
|
||||
char *eptr;
|
||||
|
||||
val = strtol(s + *off, &eptr, 0);
|
||||
if (val < -0x80000000 || val > 0xffffffff || eptr == s + *off)
|
||||
if (val < (long)-0x80000000
|
||||
|| val > (u_long)0xffffffff || eptr == s + *off)
|
||||
return (EINVAL);
|
||||
*off = eptr - s;
|
||||
val32 = (int32_t)val;
|
||||
|
Loading…
Reference in New Issue
Block a user