mailing list of musl libc
 help / color / mirror / code / Atom feed
* [musl] [PATCH] abort transaction lookup if NULL is passed as msgid1
@ 2022-03-02 20:16 psykose
  2022-03-02 20:20 ` Ariadne Conill
  0 siblings, 1 reply; 3+ messages in thread
From: psykose @ 2022-03-02 20:16 UTC (permalink / raw)
  To: musl; +Cc: psykose, Ariadne Conill

When investigating a crash in Transmission running under musl's gettext
implementation, we observed that GNU libintl returns NULL when NULL is
passed as the msgid1.  Accordingly, make the musl gettext behavior match
GNU libintl.

Reviewed-by: Ariadne Conill <ariadne@dereferenced.org>
---
 src/locale/dcngettext.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c
index d1e6c6d1..0b53286d 100644
--- a/src/locale/dcngettext.c
+++ b/src/locale/dcngettext.c
@@ -132,6 +132,9 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
 	struct binding *q;
 	int old_errno = errno;
 
+	/* match gnu gettext behaviour */
+	if (!msgid1) goto notrans;
+
 	if ((unsigned)category >= LC_ALL) goto notrans;
 
 	if (!domainname) domainname = __gettextdomain();
-- 
2.35.1


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] [PATCH] abort transaction lookup if NULL is passed as msgid1
  2022-03-02 20:16 [musl] [PATCH] abort transaction lookup if NULL is passed as msgid1 psykose
@ 2022-03-02 20:20 ` Ariadne Conill
  2022-03-02 22:07   ` Quentin Rameau
  0 siblings, 1 reply; 3+ messages in thread
From: Ariadne Conill @ 2022-03-02 20:20 UTC (permalink / raw)
  To: musl; +Cc: psykose, Ariadne Conill

Hi,

On Wed, 2 Mar 2022, psykose wrote:

> When investigating a crash in Transmission running under musl's gettext
> implementation, we observed that GNU libintl returns NULL when NULL is
> passed as the msgid1.  Accordingly, make the musl gettext behavior match
> GNU libintl.
>
> Reviewed-by: Ariadne Conill <ariadne@dereferenced.org>

I can confirm I did in fact review this.

Acked-by: Ariadne Conill <ariadne@dereferenced.org>

> ---
> src/locale/dcngettext.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/src/locale/dcngettext.c b/src/locale/dcngettext.c
> index d1e6c6d1..0b53286d 100644
> --- a/src/locale/dcngettext.c
> +++ b/src/locale/dcngettext.c
> @@ -132,6 +132,9 @@ char *dcngettext(const char *domainname, const char *msgid1, const char *msgid2,
> 	struct binding *q;
> 	int old_errno = errno;
>
> +	/* match gnu gettext behaviour */
> +	if (!msgid1) goto notrans;
> +
> 	if ((unsigned)category >= LC_ALL) goto notrans;
>
> 	if (!domainname) domainname = __gettextdomain();
> -- 
> 2.35.1
>
>

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [musl] [PATCH] abort transaction lookup if NULL is passed as msgid1
  2022-03-02 20:20 ` Ariadne Conill
@ 2022-03-02 22:07   ` Quentin Rameau
  0 siblings, 0 replies; 3+ messages in thread
From: Quentin Rameau @ 2022-03-02 22:07 UTC (permalink / raw)
  To: musl

Hi,

> Hi,
> 
> On Wed, 2 Mar 2022, psykose wrote:
> 
> > When investigating a crash in Transmission running under musl's gettext
> > implementation, we observed that GNU libintl returns NULL when NULL is
> > passed as the msgid1.  Accordingly, make the musl gettext behavior match
> > GNU libintl.
> >
> > Reviewed-by: Ariadne Conill <ariadne@dereferenced.org>
> 
> I can confirm I did in fact review this.
> 
> Acked-by: Ariadne Conill <ariadne@dereferenced.org>

I pledge I've seen Ariadne confirming reviewing this.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-03-02 22:08 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-03-02 20:16 [musl] [PATCH] abort transaction lookup if NULL is passed as msgid1 psykose
2022-03-02 20:20 ` Ariadne Conill
2022-03-02 22:07   ` Quentin Rameau

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

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 NNTP newsgroup(s).