Describe the bug
Crashes (exceptions) occur in Yara code in Low Memory situations.
There are multiple places in Yara code that allocate code but do not check for allocation failure, which later on cause exceptions in Low Memory situations.
(See usage of yr_malloc, yr_calloc, yr_realloc, yr_strdup, yr_strndup)
Describe the bug Crashes (exceptions) occur in Yara code in Low Memory situations. There are multiple places in Yara code that allocate code but do not check for allocation failure, which later on cause exceptions in Low Memory situations. (See usage of yr_malloc, yr_calloc, yr_realloc, yr_strdup, yr_strndup)
For example: In scanner.c:
new_scanner->matches = (YR_MATCHES*) yr_calloc( rules->num_strings, sizeof(YR_MATCHES));
Exception in _yr_scanner_clean_matches:
To Reproduce Test in Low Memory situations.
Expected behavior No exceptions
Please complete the following information: Issues are observed in current Yara master.