From 0f00932955521c3c2fb8140176ab72f22172c298 Mon Sep 17 00:00:00 2001 From: Marvin Borner Date: Fri, 26 Feb 2021 14:51:13 +0100 Subject: Started UBSan and stack-smashing check support --- libc/list.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'libc/list.c') diff --git a/libc/list.c b/libc/list.c index f96fb27..cf51e33 100644 --- a/libc/list.c +++ b/libc/list.c @@ -130,6 +130,7 @@ struct list *list_remove(struct list *list, struct node *node) } iterator->prev->next = iterator->next; - iterator->next->prev = iterator->prev; + if (iterator->next) + iterator->next->prev = iterator->prev; return list; } -- cgit v1.2.3