bin/98905: [PATCH] devfs(8) segfaults if the ruleset doesn't end with a newline

Maxim Konovalov maxim at macomnet.ru
Wed Jun 14 11:40:17 UTC 2006


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

From: Maxim Konovalov <maxim at macomnet.ru>
To: Fabian Keil <freebsd-listen at fabiankeil.de>
Cc: bug-followup at freebsd.org
Subject: Re: bin/98905: [PATCH] devfs(8) segfaults if the ruleset doesn't
 end with a newline
Date: Wed, 14 Jun 2006 15:32:01 +0400 (MSD)

 Hi Fabian,
 
 While your patch looks correct it is not clear for me why you removed
 assert()?
 
 Here is another version of the fix (copy&pasted):
 
 ===================================================================
 RCS file: /home/ncvs/src/sbin/devfs/devfs.c,v
 retrieving revision 1.5
 diff -u -p -r1.5 devfs.c
 --- devfs.c     22 Jan 2004 07:23:35 -0000      1.5
 +++ devfs.c     14 Jun 2006 11:30:15 -0000
 @@ -163,7 +163,7 @@ efgetln(FILE *fp, char **line)
                 if (*line == NULL)
                         errx(1, "cannot allocate memory");
                 memcpy(*line, cp, rv);
 -               *line[rv] = '\0';
 +               (*line)[rv] = '\0';
         }
         assert(rv == strlen(*line));
         return (rv);
 
 -- 
 Maxim Konovalov


More information about the freebsd-bugs mailing list