From: Florian Weimer <fweimer@redhat.com>
To: Joseph Myers <joseph@codesourcery.com>
Cc: Andreas Schwab <schwab@linux-m68k.org>,
sellcey@cavium.com, Martin Sebor <msebor@gmail.com>,
Paul Eggert <eggert@cs.ucla.edu>,
GNU C Library <libc-alpha@sourceware.org>,
Hannes Sowa <hsowa@redhat.com>
Subject: Re: [PATCH] add attribute nonstring
Date: Tue, 14 Nov 2017 18:29:00 -0000 [thread overview]
Message-ID: <5ac1ad5b-e929-e5b7-9167-87d60c592ce6@redhat.com> (raw)
In-Reply-To: <alpine.DEB.2.20.1711141824120.2574@digraph.polyomino.org.uk>
On 11/14/2017 07:27 PM, Joseph Myers wrote:
> On Tue, 14 Nov 2017, Florian Weimer wrote:
>
>> However, the original patch should really use strnlen or memchr, and not
>> strlen. As posted, the strlen is either invalid because the array is not
>> NUL-terminated, or it passes because the string is short enough.
>
> if_nametoindex takes a char * argument. POSIX doesn't say explicitly, but
> I'd presume that must be a NUL-terminated string, with undefined behavior
> otherwise. That's separate from what the kernel interface is.
Oh, you are of course right. strlen is fine under these circumstances.
So the only thing that's missing is the __set_errno (ENODEV); call, I
think. (It's what the ioctl should fail with for an unknown interface
name.)
Thanks,
Florian
next prev parent reply other threads:[~2017-11-14 18:29 UTC|newest]
Thread overview: 33+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-10 17:31 Martin Sebor
2017-11-10 17:54 ` Joseph Myers
2017-11-10 23:11 ` Martin Sebor
2017-11-10 23:46 ` Joseph Myers
2017-11-14 17:58 ` Joseph Myers
2017-11-15 22:09 ` Steve Ellcey
2017-11-15 23:05 ` Martin Sebor
2017-11-15 23:14 ` Joseph Myers
2017-11-21 5:27 ` Paul Eggert
2017-11-21 13:38 ` Joseph Myers
2017-11-12 9:06 ` Paul Eggert
2017-11-12 17:33 ` Martin Sebor
2017-11-12 20:39 ` Paul Eggert
2017-11-12 23:49 ` Martin Sebor
2017-11-13 17:35 ` Steve Ellcey
2017-11-14 16:37 ` Joseph Myers
2017-11-14 16:50 ` Florian Weimer
2017-11-14 17:06 ` Joseph Myers
2017-11-14 17:55 ` Andreas Schwab
2017-11-14 18:21 ` Florian Weimer
2017-11-14 18:27 ` Joseph Myers
2017-11-14 18:29 ` Florian Weimer [this message]
2017-11-14 23:22 ` Steve Ellcey
2017-11-15 10:48 ` Florian Weimer
2017-11-15 17:58 ` glibc failures on aarch64: (Was Re: [PATCH] add attribute nonstring) Steve Ellcey
2017-11-16 0:37 ` Adhemerval Zanella
2017-11-17 12:49 ` Szabolcs Nagy
2017-11-17 12:57 ` Florian Weimer
2017-11-13 0:50 ` [PATCH] add attribute nonstring Joseph Myers
2017-11-27 11:05 ` Siddhesh Poyarekar
2017-11-27 16:04 ` Martin Sebor
2017-11-27 16:24 ` Siddhesh Poyarekar
2017-11-27 16:26 ` Siddhesh Poyarekar
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=5ac1ad5b-e929-e5b7-9167-87d60c592ce6@redhat.com \
--to=fweimer@redhat.com \
--cc=eggert@cs.ucla.edu \
--cc=hsowa@redhat.com \
--cc=joseph@codesourcery.com \
--cc=libc-alpha@sourceware.org \
--cc=msebor@gmail.com \
--cc=schwab@linux-m68k.org \
--cc=sellcey@cavium.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).