summary refs log tree commit diff
path: root/Makefile.am
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2005-10-01 18:38:09 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2005-10-01 18:38:09 +1000
commit9b1fc991e07698d637f3dacb608be7ceb9ca853d (patch)
tree4c3e59ce4c77f32e451dda8c30076dc90d95e81c /Makefile.am
parentAdded eflag fixes for trap and minusc. (diff)
downloaddash-9b1fc991e07698d637f3dacb608be7ceb9ca853d.tar.gz
dash-9b1fc991e07698d637f3dacb608be7ceb9ca853d.zip
[INPUT] Fix NUL skipping in preadbuffer
On Sun, Sep 25, 2005 at 07:50:54PM +0000, Gerrit Pape wrote:
> On Sat, Sep 03, 2005 at 02:56:00PM +0200, Martin Dickopp wrote:
> > When analysing the bug I came to the following conclusion: The loop
> > beginning at input.c:302 overwrites a single input line with itself,
> > skipping NUL characters. Therefore, after the loop the line buffer
> > has less characters than originally read if and only if the input line
> > contains NUL characters.
>
> yes.  Thanks a lot for the details and patch.
>
> > The pointer that is used to read from the buffer, 'parsenextc' (cf.
> > input.h:66), is also used as the beginning of the next line in
> > input.c:296. This fails if the buffer contains less characters
> > than originally read into it due to NUL characters.
> >
> > The proposed patch (attached) keeps track of the number of skipped
> > characters and advances 'parsenextc' accordingly before processing
> > the next input line.
>
> Hi Herbert, please see
>  http://bugs.debian.org/317516

Instead of moving the characters in the loop, we will do memmove every
time we see a NUL character.  This hurts if there are a lot of NUL
characters, but should be a win in normal situations.
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions
it/config.c?h=1.3p1&id=ca22cbfab650ad9def1310f459d5003975a0912b&follow=1'>Avoid calling getopt_long again after it returns -1June McEnroe 2019-11-08Only change AWAY status for registered clientsJune McEnroe 2019-11-07Just write the example normallyJune McEnroe 2019-11-07Include path in readlinkat errorJune McEnroe 2019-11-07Call clientConsume before clientRecvJune McEnroe 2019-11-06Use -l:filename in Linux.mkJune McEnroe 2019-11-06Fix compat.h for #defined strlcpyJune McEnroe 2019-11-06Allow unsetting LIBRESSL_PREFIXJune McEnroe 2019-11-06Document calico service configurationJune McEnroe 2019-11-06Document SASL EXTERNAL configuration in more detailJune McEnroe 2019-11-06Document pounce service configurationJune McEnroe 2019-11-06Mention Darwin and GNU/Linux in READMEJune McEnroe 2019-11-06Assume LibreSSL from brew on DarwinJune McEnroe 2019-11-06Remove -DNO_EXPLICIT_BZERO from Darwin.mkJune McEnroe 2019-11-06Don't install rc scripts or dirs on LinuxJune McEnroe