From: Andreas Schwab <schwab@suse.de>
To: "Maciej W. Rozycki" <macro@mips.com>
Cc: <libc-alpha@sourceware.org>
Subject: Re: [PATCH] nisplus: Correct pwent parsing issue and resulting compilation error
Date: Mon, 18 Jun 2018 15:41:00 -0000 [thread overview]
Message-ID: <mvmefh4ayq0.fsf@suse.de> (raw)
In-Reply-To: <alpine.DEB.2.00.1806181539250.20622@tp.orcam.me.uk> (Maciej W. Rozycki's message of "Mon, 18 Jun 2018 16:10:27 +0100")
On Jun 18 2018, "Maciej W. Rozycki" <macro@mips.com> wrote:
> Index: glibc/nis/nss_nisplus/nisplus-parser.c
> ===================================================================
> --- glibc.orig/nis/nss_nisplus/nisplus-parser.c 2018-02-14 14:57:00.000000000 +0000
> +++ glibc/nis/nss_nisplus/nisplus-parser.c 2018-06-16 21:47:29.071633078 +0100
> @@ -82,7 +82,7 @@ _nss_nisplus_parse_pwent (nis_result *re
>
> char *numstr = NISOBJVAL (2, obj);
> len = NISOBJLEN (2, obj);
> - if (len == 0 && numstr[len - 1] != '\0')
> + if (len != 0 && numstr[len - 1] != '\0')
> {
> if (len >= room_left)
> goto no_more_room;
> @@ -98,7 +98,7 @@ _nss_nisplus_parse_pwent (nis_result *re
>
> numstr = NISOBJVAL (3, obj);
> len = NISOBJLEN (3, obj);
> - if (len == 0 && numstr[len - 1] != '\0')
> + if (len != 0 && numstr[len - 1] != '\0')
> {
> if (len >= room_left)
> goto no_more_room;
>
I don't think this is correct. If len == 0 then numstr[0] is undefined.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."
next prev parent reply other threads:[~2018-06-18 15:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-18 15:10 Maciej W. Rozycki
2018-06-18 15:25 ` Joseph Myers
2018-06-18 15:45 ` Maciej W. Rozycki
2018-06-18 15:49 ` Joseph Myers
2018-06-18 15:41 ` Andreas Schwab [this message]
2018-06-18 16:13 ` [PATCH v2] nisplus: Correct pwent parsing issue and resulting compilation error [BZ #23266] Maciej W. Rozycki
2018-06-18 19:44 ` DJ Delorie
2018-06-18 20:11 ` Maciej W. Rozycki
2018-06-18 20:40 ` DJ Delorie
2018-06-25 19:17 ` [PING][PATCH " Maciej W. Rozycki
2018-06-26 1:32 ` DJ Delorie
2018-06-27 20:14 ` [committed v3] nisplus: Correct pwent parsing issue and resulting build " Maciej W. Rozycki
2018-06-27 21:03 ` Joseph Myers
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=mvmefh4ayq0.fsf@suse.de \
--to=schwab@suse.de \
--cc=libc-alpha@sourceware.org \
--cc=macro@mips.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).