From: Pádraig Brady Date: Wed, 24 Jun 2015 16:54:16 +0000 (+0100) Subject: userspec: avoid undefined behavior in gettext call X-Git-Tag: v1.0~7034 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=402f350d06c3d307909acbec0f728ca6cfd3d1c9;p=gnulib.git userspec: avoid undefined behavior in gettext call GCC 5.1.1 -fsanitize=undefined with glibc 2.21 is returning: "runtime error: null pointer passed as argument 2, which is declared to never be null" * lib/userspec.c (parse_with_separator): Avoid passing NULL to gettext() --- diff --git a/ChangeLog b/ChangeLog index 051e06f993..1a8d095cf3 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2015-06-24 Pádraig Brady + + userspec: avoid undefined behavior in gettext call + GCC 5.1.1 -fsanitize=undefined with glibc 2.21 is returning: + "runtime error: null pointer passed as argument 2, + which is declared to never be null" + * lib/userspec.c (parse_with_separator): Avoid passing NULL to gettext() + 2015-06-20 Glenn Morris gitlog-to-changelog: improve gitmerge.el commits diff --git a/lib/userspec.c b/lib/userspec.c index 2bd092654a..84632c37c5 100644 --- a/lib/userspec.c +++ b/lib/userspec.c @@ -234,7 +234,7 @@ parse_with_separator (char const *spec, char const *separator, free (u); free (gname); - return _(error_msg); + return error_msg ? _(error_msg) : NULL; } /* Extract from SPEC, which has the form "[user][:.][group]",