-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix null derefrences while loading compiled rules #1727
Conversation
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
For 1 the backtrace looked like
For 2
I can push the test cases to |
Pushed an additional change for this
|
* Fix null derefrences while loading compiled rules * Fix nulldereference in yr_object_create * Fix assert to explicitly catch null identifier in yr_object_create
While reading compiled rules file - there are a couple of places where a NULL dereference could happen.
yr_arena_get_ptr
could returnNULL
which is not checked inyara/libyara/rules.c
Lines 333 to 343 in 929af6e
b->data
could beNULL
inyr_arena_load_stream
inyara/libyara/arena.c
Lines 597 to 610 in 929af6e
I can attach some sample testcases that could trigger these code paths.