public inbox for libc-stable@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer <fweimer@redhat.com>
To: libc-stable@sourceware.org
Subject: [2.27 COMMITTED] intl: Do not return NULL on asprintf failure in gettext [BZ #24018]
Date: Tue, 01 Jan 2019 00:00:00 -0000	[thread overview]
Message-ID: <20190102192009.7EB3C849A49E@oldenburg2.str.redhat.com> (raw)

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 c5ccff2442..a787bf619e 100644
--- a/NEWS
+++ b/NEWS
@@ -104,6 +104,7 @@ The following bugs are resolved with this release:
   [23821] si_band in siginfo_t has wrong type long int on sparc64
   [23822] ia64 static libm.a is missing exp2f, log2f and powf symbols
   [23927] Linux if_nametoindex() does not close descriptor (CVE-2018-19591)
+  [24018] gettext may return NULL
   [24027] malloc: Integer overflow in realloc
 
 \f
diff --git a/intl/dcigettext.c b/intl/dcigettext.c
index 2a50369948..25f47c5bd3 100644
--- a/intl/dcigettext.c
+++ b/intl/dcigettext.c
@@ -631,7 +631,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

                 reply	other threads:[~2019-01-02 19:20 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190102192009.7EB3C849A49E@oldenburg2.str.redhat.com \
    --to=fweimer@redhat.com \
    --cc=libc-stable@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).