diff options
author | Niraj Kumar Goit <niraj.g@samsung.com> | 2019-04-15 19:28:29 +0530 |
---|---|---|
committer | Jaehyun Kim <jeik01.kim@samsung.com> | 2019-04-18 13:08:12 +0900 |
commit | 691331a74f4739261a0e294d7dff107a4c3cbeac (patch) | |
tree | d7f0f73d44edb0cec35e26a679f504340dfaf502 | |
parent | 524930d4f53da772edeaa9fce93f5daf1a382b4f (diff) | |
download | curl-tizen_4.0_tv.tar.gz curl-tizen_4.0_tv.tar.bz2 curl-tizen_4.0_tv.zip |
Curl_llist_remove: fix potential NULL pointer dereftizen_4.0_tv
Backported patch details:-
https://github.com/curl/curl/commit/a6aa78aa2a97fc5bd641ba0ea0807a2493e25df0.patch
Change-Id: I43195a05b07c57818a1f4cbd90f06e5240b93469
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rw-r--r-- | lib/llist.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/llist.c b/lib/llist.c index b8836bbcc..db664889f 100644 --- a/lib/llist.c +++ b/lib/llist.c @@ -110,7 +110,11 @@ Curl_llist_remove(struct curl_llist *list, struct curl_llist_element *e, e->next->prev = NULL; } else { - e->prev->next = e->next; + if(!e->prev) + list->head = e->next; + else + e->prev->next = e->next; + if(!e->next) list->tail = e->prev; else |