Fix edgecase (4...4 is invalid)
This commit is contained in:
parent
b0d7141379
commit
4118c4b573
2 changed files with 2 additions and 1 deletions
|
@ -17,7 +17,7 @@ isinetaddr(const char *str)
|
||||||
|
|
||||||
for (size_t l = 0; l < len; l++) {
|
for (size_t l = 0; l < len; l++) {
|
||||||
if (str[l] == '.') {
|
if (str[l] == '.') {
|
||||||
if (octets == 2 && digits == 0) {
|
if (buflen == 0) {
|
||||||
return 0;
|
return 0;
|
||||||
} else if (!in_range(buf, buflen)) {
|
} else if (!in_range(buf, buflen)) {
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
@ -25,6 +25,7 @@ const char *invalid[] = {
|
||||||
".......",
|
".......",
|
||||||
"192.2.2.",
|
"192.2.2.",
|
||||||
"...4",
|
"...4",
|
||||||
|
"4...4",
|
||||||
NULL
|
NULL
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue