From owner-freebsd-bugs@FreeBSD.ORG Wed Jun 14 11:40:17 2006 Return-Path: X-Original-To: freebsd-bugs@hub.freebsd.org Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 18D7C16A47A for ; Wed, 14 Jun 2006 11:40:17 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [216.136.204.21]) by mx1.FreeBSD.org (Postfix) with ESMTP id 8349243D69 for ; Wed, 14 Jun 2006 11:40:16 +0000 (GMT) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.13.4/8.13.4) with ESMTP id k5EBeGg0007394 for ; Wed, 14 Jun 2006 11:40:16 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.13.4/8.13.4/Submit) id k5EBeGEZ007393; Wed, 14 Jun 2006 11:40:16 GMT (envelope-from gnats) Date: Wed, 14 Jun 2006 11:40:16 GMT Message-Id: <200606141140.k5EBeGEZ007393@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Maxim Konovalov Cc: Subject: Re: bin/98905: [PATCH] devfs(8) segfaults if the ruleset doesn't end with a newline X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Maxim Konovalov List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 14 Jun 2006 11:40:17 -0000 The following reply was made to PR bin/98905; it has been noted by GNATS. From: Maxim Konovalov To: Fabian Keil Cc: bug-followup@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