Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170324183637.GI17319@brightrain.aerifal.cx>
Date: Fri, 24 Mar 2017 14:36:37 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Re: fallback to no translations when gettext("")

On Thu, Mar 23, 2017 at 01:05:55PM +0800, He X wrote:
> Hi, rich, happy that you merged the changes related to dcngettext(). But
> you seems forget this simple patch and did not get it with those changes.
> So i bump it again now. Hope you do not mind if you still remember it.
> 
> He X
> 
> 2017-03-04 16:08 GMT+08:00 He X <xw897002528@...il.com>:
> 
> > following http://www.openwall.com/lists/musl/2017/02/13/8 ,
> > http://www.openwall.com/lists/musl/2017/03/04/1 and
> > http://www.openwall.com/lists/musl/2017/02/13/5:
> >
> > > gnu tar showed me segfaults, because he passed a zero msgid1 causing
> > __mo_lookup segfault, we should add a check in dcngettext to avoid it(if
> > (!msgid1) goto notrans;):
> >
> >  #2  0x00007ffff7d82a6f in dcngettext (domainname=0x6737a0 "tar",
> > msgid1=0x0, msgid2=0x0, n=1,
> >     category=5) at src/locale/dcngettext.c:211

Indeed, I did forget. But looking at it more closely, according to the
GNU gettext manual I think this is a bug in GNU tar:

    "If the argument is NULL the result is undefined."

https://www.gnu.org/software/gettext/manual/html_node/Interface-to-gettext.html

Whether we commit this patch or not, I think it should be reported as
a bug in GNU tar.

Given that the API documentation says a NULL pointer is not valid
here, my leaning, in alignment with existing musl practice, is _not_
to make it silently "work" but to leave it crashing, so that this sort
of bug is caught. But if the documentation is wrong and the practice
of passing null pointers here is widely accepted we can reconsider.

Rich

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.