Add check for null pointers in yr_lex_parse_rules_bytes and yr_lex_parse_rules_string

Closes #2139
This commit is contained in:
Victor M. Alvarez
2025-02-27 11:43:44 +01:00
parent 53642c3fcb
commit 93d1de6db6
2 changed files with 12 additions and 0 deletions
+6
View File
@@ -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;
+6
View File
@@ -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;