public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
* [2.26 COMMITTED] intl: Do not return NULL on asprintf failure in gettext [BZ #24018]
@ 2019-01-01  0:00 Florian Weimer
  0 siblings, 0 replies; only message in thread
From: Florian Weimer @ 2019-01-01  0:00 UTC (permalink / raw)
  To: libc-stable

Fixes commit 9695dd0c9309712ed8e9c17a7040fe7af347f2dc ("DCIGETTEXT:
Use getcwd, asprintf to construct absolute pathname").

(cherry picked from commit 8c1aafc1f34d090a5b41dc527c33e8687f6a1287)

2019-01-02  Florian Weimer  <fweimer@redhat.com>

	[BZ #24018]
	* intl/dcigettext.c (DCIGETTEXT): Do not return NULL on asprintf
	failure.

diff --git a/NEWS b/NEWS
index ef857b6e6c..49895f81bd 100644
--- a/NEWS
+++ b/NEWS
@@ -163,6 +163,7 @@ The following bugs are resolved with this release:
   [23579] libc: Errors misreported in preadv2
   [23709] Fix CPU string flags for Haswell-type CPUs
   [23927] Linux if_nametoindex() does not close descriptor (CVE-2018-19591)
+  [24018] gettext may return NULL
   [24027] malloc: Integer overflow in realloc
 \f
 Version 2.26
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index f63b34b0f5..cfcdd304b4 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -635,7 +635,7 @@ DCIGETTEXT (const char *domainname, const char *msgid1, const char *msgid2,
 	  int ret = __asprintf (&xdirname, "%s/%s", cwd, dirname);
 	  free (cwd);
 	  if (ret < 0)
-	      return NULL;
+	    goto return_untranslated;
 	  dirname = xdirname;
 	}
 #ifndef IN_LIBGLOCALE

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-01-02 19:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-01  0:00 [2.26 COMMITTED] intl: Do not return NULL on asprintf failure in gettext [BZ #24018] Florian Weimer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).