qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH] sockets: avoid formatting buffer that may not b


From: Stefan Hajnoczi
Subject: Re: [Qemu-devel] [PATCH] sockets: avoid formatting buffer that may not be NULL terminated
Date: Wed, 5 Jul 2017 14:41:04 +0100
User-agent: Mutt/1.8.0 (2017-02-23)

On Mon, Jun 26, 2017 at 12:19:40PM +0200, Thomas Huth wrote:
> On 26.06.2017 12:11, Daniel P. Berrange wrote:
> > The 'sun_path' field in the sockaddr_un struct is not required
> > to be NULL termianted, so when reporting an error, we must use
> 
> s/NULL/NUL/
> 
> NULL is a pointer, NUL is the '\0' character.

I wanted to point out the same thing to someone recently, so I chased up
a reference to the NUL character in RFC 20 "ASCII format for Network
Interchange".  After all, no one can argue with an RFC.

What I found shocked me!  There must be a typo in the ASCII RFC:
https://tools.ietf.org/html/rfc20#section-5.2

I closed my browser tab quickly and headed to Wikipedia instead.  If the
primary source didn't support my argument, I could always count on good
old Wikipedia...

But do you know what I found?  Someone had conflated nul and null on the
Wikipedia entry:
https://en.wikipedia.org/wiki/Null_character

Amateurs!  The Wikipedia editors probably didn't have the intellectual
calibre to question the correctness of the RFC text the way I did.

But to cut a long story short, as my search continued the evidence
became overwhelming.  It is acceptable to refer to the nul character as
the null character.

Coming back to the patch in question, although we can't complain about
the "NULL" it's with considerable joy that I'd like to highlight:

s/termianted/terminated/

:)
Stefan

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]