Fixed a possible buffer overflow issue
This commit is contained in:
parent
cd548da226
commit
44f6f16953
@ -527,7 +527,7 @@ BOOL tls_match_hostname(char *pattern, int pattern_length, char *hostname)
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
if (pattern_length > 2 && pattern[0] == '*' && pattern[1] == '.')
|
||||
if (pattern_length > 2 && pattern[0] == '*' && pattern[1] == '.' && strlen(hostname) >= pattern_length)
|
||||
{
|
||||
char *check_hostname = &hostname[ strlen(hostname) - pattern_length+1 ];
|
||||
if (memcmp((void*) check_hostname, (void*) &pattern[1], pattern_length - 1) == 0 )
|
||||
|
Loading…
x
Reference in New Issue
Block a user