From 52a1a58e14473def317f9e306ef0b93701b64427 Mon Sep 17 00:00:00 2001 From: rlar Date: Thu, 13 Oct 2016 17:52:16 +0200 Subject: [PATCH] wlist.c, wl_find(), avoid crash when `string' argument is NULL --- src/misc/wlist.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/misc/wlist.c b/src/misc/wlist.c index 4dd6bf5d4..9bd24a549 100644 --- a/src/misc/wlist.c +++ b/src/misc/wlist.c @@ -347,6 +347,9 @@ wl_chop_rest(wordlist *wl) wordlist * wl_find(const char *string, const wordlist *wl) { + if (!string) + return NULL; + for (; wl; wl = wl->wl_next) if (eq(string, wl->wl_word)) break;