gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[GNUnet-SVN] [gnurl] 89/116: Curl_llist_remove: fix potential NULL point


From: gnunet
Subject: [GNUnet-SVN] [gnurl] 89/116: Curl_llist_remove: fix potential NULL pointer deref
Date: Tue, 05 Dec 2017 14:51:59 +0100

This is an automated email from the git hooks/post-receive script.

ng0 pushed a commit to branch master
in repository gnurl.

commit cec0734b4c3a396d22e0c9e30f613d8255f431bf
Author: Daniel Stenberg <address@hidden>
AuthorDate: Mon Nov 20 22:59:19 2017 +0100

    Curl_llist_remove: fix potential NULL pointer deref
    
    Fixes a scan-build warning.
---
 lib/llist.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/lib/llist.c b/lib/llist.c
index 4bb0a51b8..f8769c2af 100644
--- a/lib/llist.c
+++ b/lib/llist.c
@@ -106,7 +106,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

-- 
To stop receiving notification emails like this one, please contact
address@hidden



reply via email to

[Prev in Thread] Current Thread [Next in Thread]