ruby: fix wrong memory access in catMatch
fuzz target reports canMatch access wrong memory area when php-anonymous_functions.d/input.php is given as input. This patch fixes it. Signed-off-by: Masatake YAMATO <yamato@redhat.com>
This commit is contained in:
parent
a71dbcbeca
commit
68322fcb54
@ -81,6 +81,11 @@ static vString* stringListToScope (const stringList* list)
|
||||
static boolean canMatch (const unsigned char** s, const char* literal)
|
||||
{
|
||||
const int literal_length = strlen (literal);
|
||||
const int s_length = strlen ((const char *)*s);
|
||||
|
||||
if (s_length < literal_length)
|
||||
return FALSE;
|
||||
|
||||
const unsigned char next_char = *(*s + literal_length);
|
||||
if (strncmp ((const char*) *s, literal, literal_length) != 0)
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user