mirror of
https://github.com/VirusTotal/yara.git
synced 2026-10-12 02:10:00 +00:00
Add check for null pointers in yr_lex_parse_rules_bytes and yr_lex_parse_rules_string
Closes #2139
This commit is contained in:
@@ -3549,6 +3549,9 @@ int yr_lex_parse_rules_bytes(
|
||||
|
||||
compiler->errors = 0;
|
||||
|
||||
if (rules_data == NULL)
|
||||
return 0;
|
||||
|
||||
if (yylex_init(&yyscanner) != 0)
|
||||
{
|
||||
compiler->errors = 1;
|
||||
@@ -3581,6 +3584,9 @@ int yr_lex_parse_rules_string(
|
||||
|
||||
compiler->errors = 0;
|
||||
|
||||
if (rules_string == NULL)
|
||||
return 0;
|
||||
|
||||
if (yylex_init(&yyscanner) != 0)
|
||||
{
|
||||
compiler->errors = 1;
|
||||
|
||||
@@ -895,6 +895,9 @@ int yr_lex_parse_rules_bytes(
|
||||
|
||||
compiler->errors = 0;
|
||||
|
||||
if (rules_data == NULL)
|
||||
return 0;
|
||||
|
||||
if (yylex_init(&yyscanner) != 0)
|
||||
{
|
||||
compiler->errors = 1;
|
||||
@@ -927,6 +930,9 @@ int yr_lex_parse_rules_string(
|
||||
|
||||
compiler->errors = 0;
|
||||
|
||||
if (rules_string == NULL)
|
||||
return 0;
|
||||
|
||||
if (yylex_init(&yyscanner) != 0)
|
||||
{
|
||||
compiler->errors = 1;
|
||||
|
||||
Reference in New Issue
Block a user