Merge pull request #171 from liyang1009/master

fix bug about stack corrupt for example  ip address is spceial  ip 172.16.107.7, Proxy:False, 210.3.213.69
This commit is contained in:
Lion 2020-10-11 17:16:28 +08:00 committed by GitHub
commit e8c9b3916c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 4 deletions

View File

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