From: Bruno Haible Date: Sat, 3 Jun 2023 11:56:37 +0000 (+0200) Subject: Silence "potential null pointer dereference" warnings. X-Git-Tag: v0.22~46 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1db874bef9099274a13b359e04a30504fae2081a;p=thirdparty%2Fgettext.git Silence "potential null pointer dereference" warnings. Pinpointed by gcc 13 warning: warning: potential null pointer dereference [-Wnull-dereference] * gettext-tools/src/xg-arglist-context.c: Include verify.h. (flag_context_list_table_add): Assert that the entry is non-NULL. --- diff --git a/gettext-tools/src/xg-arglist-context.c b/gettext-tools/src/xg-arglist-context.c index 14f37cb5f..f89a4be3d 100644 --- a/gettext-tools/src/xg-arglist-context.c +++ b/gettext-tools/src/xg-arglist-context.c @@ -26,6 +26,7 @@ #include "xalloc.h" #include "xmalloca.h" +#include "verify.h" /* Null context. */ @@ -179,6 +180,9 @@ flag_context_list_table_add (flag_context_list_table_ty *table, } else { + /* We don't put NULL entries into the table. */ + assume (entry != NULL); + flag_context_list_ty *list = (flag_context_list_ty *)entry; flag_context_list_ty **lastp = NULL; /* Invariant: list == (lastp != NULL ? *lastp : entry). */