Commit 52f3a565 authored by Nikias Bassen's avatar Nikias Bassen

libcnary: Fix possible NULL pointer dereference in node_iterator_create()

When NULL is passed to node_iterator_create() the code tries to access
the begin element of the node list and causes a NULL pointer dereference.
The value of list is checked a few lines down and iterator->value is then
properly assigned in node_iterator_bind().
parent ad1a95e9
......@@ -47,7 +47,7 @@ node_iterator_t* node_iterator_create(node_list_t* list) {
iterator->end = NULL;
iterator->begin = NULL;
iterator->value = list->begin;
iterator->value = NULL;
iterator->list = NULL;
iterator->next = node_iterator_next;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment