-
Notifications
You must be signed in to change notification settings - Fork 181
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
In luajit, a null pointer is distinct from nil, and thus "truthy". That is to say, `if not c_ffi_struct` will never evaluate to true, even if the struct is null. However, a null ffi struct does compare equal to nil, so the new comparison corrects this issue. This fixes numerous bugs in this library, including multiple cases of uninitialized data being passed into functions leading to null pointer dereferences, buffer overflows, and more.
- Loading branch information
Showing
1 changed file
with
11 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters