fix bug about stack corrupt for example ip address is spceial "172.16.107.7, Proxy:False, 210.3.213.69"

This commit is contained in:
liyang 2020-10-06 21:55:21 +08:00
parent e17286e324
commit ea5bfb52e0
1 changed files with 4 additions and 4 deletions

View File

@ -401,12 +401,12 @@ IP2R_API uint_t ip2long(const char *ip)
continue; continue;
} }
if ( i > 3 ) {
ipval = 0;
break;
}
if ( *cs == '.' ) { if ( *cs == '.' ) {
//single part length limit //single part length limit
if ( i > 3 ) {
ipval = 0;
break;
}
if ( p < 0 ) break; if ( p < 0 ) break;
buffer[i] = '\0'; buffer[i] = '\0';