ip4: ip4addr_aton: fix parsing of the octal IP representation

This commit is contained in:
Karol Domagalski 2020-03-05 11:34:59 +01:00 committed by Simon Goldschmidt
parent adbc5b5f71
commit 2e175a23cb

View File

@ -173,6 +173,8 @@ ip4addr_aton(const char *cp, ip4_addr_t *addr)
} }
for (;;) { for (;;) {
if (lwip_isdigit(c)) { if (lwip_isdigit(c)) {
if((base == 8) && ((u32_t)(c - '0') >= 8))
break;
val = (val * base) + (u32_t)(c - '0'); val = (val * base) + (u32_t)(c - '0');
c = *++cp; c = *++cp;
} else if (base == 16 && lwip_isxdigit(c)) { } else if (base == 16 && lwip_isxdigit(c)) {