Skip to content

Fix a NULL pointer dereference of spl_ptr_llist_offset() #8272

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

Closed
wants to merge 1 commit into from

Conversation

zhou1615
Copy link
Contributor

spl_ptr_llist_offset() will return NULL when offset is invalid. However
in the function zim_SplDoublyLinkedList_add(), the return value of
spl_ptr_llist_offset() is directly used without check, which could
lead to possible NULL pointer dereference.

Fix this bug by adding the check of spl_ptr_llist_offset() like others.

This bug is found by a static analyzer, making it hard to reproduce.

@zhou1615 zhou1615 force-pushed the spl_ptr_llist_offset branch from 3276e8d to 4b95210 Compare March 30, 2022 01:56
spl_ptr_llist_offset() will return NULL when offset is invalid. However
in the function zim_SplDoublyLinkedList_add(), the return value of
spl_ptr_llist_offset() is directly used without check, which could
lead to possible NULL pointer dereference.

Fix this bug by adding the check of spl_ptr_llist_offset() like others.

This bug is found by a static analyzer, making it hard to reproduce.
@zhou1615 zhou1615 force-pushed the spl_ptr_llist_offset branch from 4b95210 to 70d24d3 Compare March 30, 2022 01:57
@cmb69 cmb69 closed this in 48e0707 Mar 30, 2022
@cmb69
Copy link
Member

cmb69 commented Mar 30, 2022

Thank you! Since this is not bug (fix), I've applied the patch to master only.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants