[Top][All Lists]

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

Re: Fwd: [bug-inetutils] [PATCH] fix whitespace parsing in syslogd

From: Marcus Brinkmann
Subject: Re: Fwd: [bug-inetutils] [PATCH] fix whitespace parsing in syslogd
Date: Tue, 2 Sep 2003 22:32:17 +0200
User-agent: Mutt/1.5.4i

On Tue, Sep 02, 2003 at 01:10:22PM +0100, Julian Gilbey wrote:
> Applied; works correctly.

Thanks for testing it.
> > > patch I submitted also fixed another part of the code, which dealt
> > > with the input line being too long.  I wouldn't want to see that lost,
> > > either.
> > 
> > The bug report contained no information about that, and you didn't write a
> > changelog for your patch.  So if there is another bug beside the problematic
> > whitespace, we will need another report for that and we can take a look at
> > it.
> Sorry, here goes.  (Not exactly sure what you mean by "we will need
> another report, though.)

Well, that was another report :)

> --- syslogd/syslogd.c.orig    2003-08-23 22:34:40.000000000 +0100
> +++ syslogd/syslogd.c 2003-08-24 00:39:27.000000000 +0100
> @@ -1679,7 +1679,7 @@

Please use the -p option to patch so it shows function names.

Also, please consider to write a ChangeLog entry according to our standards
when submitting a patch.

> +       cline = cbuf + offset + len - 1;  /* reset cline for new cbuf */

And last but not least, follow the GNU coding standard ;)
Comments should be full sentences, with correct ortography (ie, uppercase,
witha final period).  In this case, the comment does not explain the code,
but repeats it, which is unnecessary.  So I removed it.

> The rest of the patch is more subtle: it is in the section of the code
> which deals with what happens if a configuration file line is too
> long.  What happened in the original is that cbuf was realloc'd in
> such a case, but then line 1714 does a meaningless strcpy from cline -
> which is a pointer into the *old* cbuf - into the new cbuf, which is
> unnecessary as realloc guarantees to copy the old cbuf into the newly
> allocated memory.  So instead, what is needed is simply for cline to
> be set the the correct place in the new cbuf, and this patch does this
> task.  (Note that offset needs to be calculated *before* the realloc!)

Right, the code was bogus.  Thanks for spotting this and submitting a fix.


`Rhubarb is no Egyptian god.' GNU      http://www.gnu.org    address@hidden
Marcus Brinkmann              The Hurd http://www.gnu.org/software/hurd/

reply via email to

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