diff options
| author | 2016-11-10 02:51:54 +0100 | |
|---|---|---|
| committer | 2016-11-10 02:51:54 +0100 | |
| commit | 52f3a565deca246e0a331f4a014178c3f6927f31 (patch) | |
| tree | 058463dd9cf789546b90fe4078545bec22231577 | |
| parent | ad1a95e96218e411b4dbde38c002fc5f4b530a65 (diff) | |
| download | libplist-52f3a565deca246e0a331f4a014178c3f6927f31.tar.gz libplist-52f3a565deca246e0a331f4a014178c3f6927f31.tar.bz2 | |
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().
| -rw-r--r-- | libcnary/node_iterator.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libcnary/node_iterator.c b/libcnary/node_iterator.c index dedf3b4..e629b73 100644 --- a/libcnary/node_iterator.c +++ b/libcnary/node_iterator.c | |||
| @@ -47,7 +47,7 @@ node_iterator_t* node_iterator_create(node_list_t* list) { | |||
| 47 | 47 | ||
| 48 | iterator->end = NULL; | 48 | iterator->end = NULL; |
| 49 | iterator->begin = NULL; | 49 | iterator->begin = NULL; |
| 50 | iterator->value = list->begin; | 50 | iterator->value = NULL; |
| 51 | 51 | ||
| 52 | iterator->list = NULL; | 52 | iterator->list = NULL; |
| 53 | iterator->next = node_iterator_next; | 53 | iterator->next = node_iterator_next; |
