mirror of
https://github.com/opnsense/src.git
synced 2026-05-28 04:12:45 -04:00
Fixed parsing of unsigned integers.
This commit is contained in:
parent
2319835713
commit
91b756f435
1 changed files with 4 additions and 1 deletions
|
|
@ -535,7 +535,10 @@ ng_int32_parse(const struct ng_parse_type *type,
|
|||
int32_t val32;
|
||||
char *eptr;
|
||||
|
||||
val = strtol(s + *off, &eptr, 0);
|
||||
if ((intptr_t)type->info == INT_SIGNED)
|
||||
val = strtol(s + *off, &eptr, 0);
|
||||
else
|
||||
val = strtoul(s + *off, &eptr, 0);
|
||||
if (val < (int32_t)0x80000000
|
||||
|| val > (u_int32_t)0xffffffff || eptr == s + *off)
|
||||
return (EINVAL);
|
||||
|
|
|
|||
Loading…
Reference in a new issue