From: "H.J. Lu via Libc-alpha" <libc-alpha@sourceware.org>
To: Andreas Schwab <schwab@linux-m68k.org>
Cc: libc-alpha@sourceware.org
Subject: Re: Fix argv overrun in getconf (bug 27761)
Date: Wed, 21 Apr 2021 07:28:58 -0700 [thread overview]
Message-ID: <CAMe9rOr8=XmBPye5j7p=EXmasoior_Ng5H0v16k5f2iUUD-5NA@mail.gmail.com> (raw)
In-Reply-To: <87a6prbxu7.fsf@igel.home>
On Wed, Apr 21, 2021 at 7:20 AM Andreas Schwab <schwab@linux-m68k.org> wrote:
>
> Correct argument counter accounting when processing the -v option with the
> argument directly attached.
> ---
> posix/getconf.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/posix/getconf.c b/posix/getconf.c
> index efc9623b3b..4dccc9cbf2 100644
> --- a/posix/getconf.c
> +++ b/posix/getconf.c
> @@ -519,7 +519,7 @@ environment SPEC.\n\n"));
> else
> {
> argv += 1;
> - argc += 1;
> + argc -= 1;
> }
> }
> #else
> @@ -544,7 +544,7 @@ environment SPEC.\n\n"));
> {
> spec = &argv[1][2];
> argv += 1;
> - argc += 1;
> + argc -= 1;
> }
> }
> else
> --
> 2.31.1
>
LGTM.
Thanks.
--
H.J.
prev parent reply other threads:[~2021-04-21 14:29 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-21 12:56 Fix argv overrun in getconf (bug 27761) Andreas Schwab
2021-04-21 13:08 ` Florian Weimer via Libc-alpha
2021-04-21 14:28 ` H.J. Lu via Libc-alpha [this message]
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://www.gnu.org/software/libc/involved.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAMe9rOr8=XmBPye5j7p=EXmasoior_Ng5H0v16k5f2iUUD-5NA@mail.gmail.com' \
--to=libc-alpha@sourceware.org \
--cc=hjl.tools@gmail.com \
--cc=schwab@linux-m68k.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).