mirror of git://git.sysmocom.de/ofono
huaweimodem: Fix DHCP parsing on 32-bit platforms
strtol clamps returned value between INT_MIN and INT_MAX, causing invalid value (255.255.255.127) being reported for any address if last octet > 127 when sizeof(long) == 4.
This commit is contained in:
parent
27f9da901f
commit
54c9068ff2
|
@ -80,7 +80,7 @@ static gboolean get_next_addr(GAtResultIter *iter, char **addr)
|
|||
if (g_at_result_iter_next_unquoted_string(iter, &str) == FALSE)
|
||||
return FALSE;
|
||||
|
||||
val = strtol(str, NULL, 16);
|
||||
val = strtoul(str, NULL, 16);
|
||||
|
||||
if (addr)
|
||||
*addr = g_strdup_printf("%u.%u.%u.%u",
|
||||
|
|
Loading…
Reference in New Issue