NetBSD-Bugs archive

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

Re: lib/53640: getnstr(3) shall read at most n characters, not n-1



The following reply was made to PR lib/53640; it has been noted by GNATS.

From: Valery Ushakov <uwe%stderr.spb.ru@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: lib/53640: getnstr(3) shall read at most n characters, not n-1
Date: Sat, 29 Sep 2018 16:46:42 +0300

 On Sat, Sep 29, 2018 at 10:30:01 +0000, n54%gmx.com@localhost wrote:
 
 > It's documented in POSIX to reat at most N bytes; but the NetBSD
 > curses(3) version reads at most N-1 bytes.
 > 
 > http://pubs.opengroup.org/onlinepubs/7908799/xcurses/getnstr.html
 
 I don't think that definition is precise enough.  It doesn't
 explicitly say if the buffer is NUL terminated on overflow.
 
 
 > While the NetBSD curses(3) behavior might be defendable it diverges
 > from the idiom of gets(3) + fgets(3). fgets(3) is documented to read
 > at most N-1 characters and it does so.
 
 > >How-To-Repeat:
 
 Is it really that hard to explicitly quote the results you observe
 with these tests?  I find it rather disingenuous.  Can't you
 explicitly state your point?
 
 
 -uwe
 


Home | Main Index | Thread Index | Old Index