chiark / gitweb /
[PATCH] udev - read long lines from config files overflow fix
authorarun@codemovers.org <arun@codemovers.org>
Sat, 11 Sep 2004 03:54:04 +0000 (20:54 -0700)
committerGreg KH <gregkh@suse.de>
Wed, 27 Apr 2005 04:37:00 +0000 (21:37 -0700)
commit3e4414508b409a21b023b9ca4532f62003e0db97
tree5061b4906705b6af3bf200665bde43a37d3f461e
parentbdde56de3993d8793b9af853f389f26f19541292
[PATCH] udev - read long lines from config files overflow fix

Hi Kay,

On 23:12 Sat 04 Sep     , Kay Sievers wrote:
> Cool, a real bug :)
> Thanks, for the patch. I think it would be better to skip lenghth exceeding
> lines instead of cutting it and continue. While looking at it I restructured
> the buffer reading logic a bit and fixed another stupid bug.
Thanks for the cleanup.

You may have overlooked the fix for udev_config.c(parsing udev.conf) in
your patch.  So, I've adapted the fixes you applied to namedev_parse.c
to this file also.

Also, while 'eating' the whitespace the 'count' doesn't get decremented.
This leads strncpy to copy the number of whitespace minus 1 characters
from the next line. Minus 1 because it copies '\n' from the current
line.

while (isspace(bufline[0])) {
bufline++;
+ count--;
}
.
.
.
strncpy(line, bufline, count);

Included patch(against udev-030) contains the above fixes as well as
your fixes.

Signed-off-by: Arun Bhanu <arun@codemovers.org>
klibc_fixups.c
namedev_parse.c
udev.h
udev_config.c