Avoid indexing 'str' with a negative index
On OpenBSD - this can cause a crash.
This commit is contained in:
parent
1c2778131f
commit
75dbfb7166
1 changed files with 1 additions and 1 deletions
|
@ -35,7 +35,7 @@ isinetaddr4(const char *str)
|
||||||
digits++;
|
digits++;
|
||||||
if (!within_range(buf)) {
|
if (!within_range(buf)) {
|
||||||
return false;
|
return false;
|
||||||
} else if (str[i-1] == SEP) {
|
} else if (i > 0 && str[i-1] == SEP) {
|
||||||
octets++;
|
octets++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue