bug-gnulib@gnu.org mirror (unofficial)
 help / color / mirror / Atom feed
From: Bruno Haible <bruno@clisp.org>
To: bug-gnulib@gnu.org
Cc: He X <xw897002528@gmail.com>
Subject: Re: argp: pass NULL as msgid to dgettext without checks
Date: Sat, 05 Jan 2019 13:46:12 +0100	[thread overview]
Message-ID: <2335329.Y8mJzGh49y@omega> (raw)
In-Reply-To: <CAPG2z0-iUzO9PmkAVULh0hnGK-tBAzqoh=HYof6kXQf7+WqUkQ@mail.gmail.com>

Hi,

He X wrote on 2018-12-22:
> according to
> https://www.gnu.org/software/gettext/manual/html_node/Interface-to-gettext.html,
> passing NULL to gettext is undefined.

Likewise the LI18NUX 2000 specification (p. 39) says
  "The msgid argument is a null-terminated string."

And likewise the LSB 3.0
https://refspecs.linuxfoundation.org/LSB_3.0.0/LSB-PDA/LSB-PDA/baselib-dgettext.html

> since my libc is musl, tar is using builtin argp implementation, which will
> pass NULL as msgid to dgettext without additional checks.
> 
> 
> could you please check if msgid is NULL before passing it to dgettext? the
> problem code is located at argp-help.c.

I don't see which dgettext invocation in argp-help.c is the one that needs the
NULL check. Can you please provide a stack trace (from gdb, from a 'tar' program
built with CFLAGS="-ggdb") of the crash?

Bruno



  reply	other threads:[~2019-01-05 12:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-22  8:06 argp: pass NULL as msgid to dgettext without checks He X
2019-01-05 12:46 ` Bruno Haible [this message]
     [not found]   ` <CAPG2z086RQHgR4RbYKXMm+9MqUHzkSZhim9viCRVJw9LB3i-Bw@mail.gmail.com>
2019-01-05 16:17     ` Bruno Haible
2019-01-06  2:05       ` He X

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

  List information: https://lists.gnu.org/mailman/listinfo/bug-gnulib

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

  git send-email \
    --in-reply-to=2335329.Y8mJzGh49y@omega \
    --to=bruno@clisp.org \
    --cc=bug-gnulib@gnu.org \
    --cc=xw897002528@gmail.com \
    /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).