summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2019-04-15 19:28:29 +0530
committerJaehyun Kim <jeik01.kim@samsung.com>2019-04-18 13:08:12 +0900
commit691331a74f4739261a0e294d7dff107a4c3cbeac (patch)
treed7f0f73d44edb0cec35e26a679f504340dfaf502
parent524930d4f53da772edeaa9fce93f5daf1a382b4f (diff)
downloadcurl-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.c6
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