Skip to content

Commit

Permalink
When we find an error in a yara file, exit instead of continuing to p…
Browse files Browse the repository at this point in the history
…arse

The yara parser can potentially overwrite heap buffers parsing invalid yara files.
Exit on error to avoid this.  These overwrites are only observed when running
with address sanitization and mpool disabled.
  • Loading branch information
ragusaa committed Feb 27, 2024
1 parent 24226f7 commit 2192b9e
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions libclamav/yara_grammar.c
Original file line number Diff line number Diff line change
Expand Up @@ -3649,6 +3649,8 @@ YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
}
# undef YYSYNTAX_ERROR
#endif
/*Exit out, no reason to continue parsing, since we have already found errors.*/
goto yyreturn;
}


Expand Down

0 comments on commit 2192b9e

Please sign in to comment.