From 307361e12c9d670668efcc0b494c9cb9e00941a0 Mon Sep 17 00:00:00 2001 From: twinaphex Date: Thu, 2 Jun 2016 20:53:26 +0200 Subject: [PATCH] Prevent 'explicit null dereferenced' warning --- list_special.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/list_special.c b/list_special.c index 03e2562b69..def939a698 100644 --- a/list_special.c +++ b/list_special.c @@ -260,8 +260,13 @@ struct string_list *string_list_new_special(enum string_list_type type, for (i = 0; i < *list_size; i++) { + const char *opt = NULL; const core_info_t *info = (const core_info_t*)&core_info[i]; - const char *opt = info->display_name; + + if (!info) + goto error; + + opt = info->display_name; if (!opt) goto error;