Fix core dump caused by non-zerod memory.
From Auster in current_users.
This commit is contained in:
parent
cb88d60f6d
commit
861fc6431d
@ -1,4 +1,4 @@
|
|||||||
/* $NetBSD: parse.c,v 1.22 2006/09/23 21:19:34 elad Exp $ */
|
/* $NetBSD: parse.c,v 1.23 2006/10/09 11:37:31 dsl Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1989, 1993
|
* Copyright (c) 1989, 1993
|
||||||
@ -38,7 +38,7 @@
|
|||||||
#if 0
|
#if 0
|
||||||
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93";
|
static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93";
|
||||||
#else
|
#else
|
||||||
__RCSID("$NetBSD: parse.c,v 1.22 2006/09/23 21:19:34 elad Exp $");
|
__RCSID("$NetBSD: parse.c,v 1.23 2006/10/09 11:37:31 dsl Exp $");
|
||||||
#endif
|
#endif
|
||||||
#endif /* not lint */
|
#endif /* not lint */
|
||||||
|
|
||||||
@ -227,7 +227,8 @@ rewrite(FS *fs)
|
|||||||
*/
|
*/
|
||||||
nextpr = &fu->nextpr;
|
nextpr = &fu->nextpr;
|
||||||
for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
|
for (nconv = 0, fmtp = fu->fmt; *fmtp; nextpr = &pr->nextpr) {
|
||||||
pr = emalloc(sizeof(PR));
|
pr = emalloc(sizeof *pr);
|
||||||
|
memset(pr, 0, sizeof *pr);
|
||||||
*nextpr = pr;
|
*nextpr = pr;
|
||||||
|
|
||||||
/* Skip preceding text and up to the next % sign. */
|
/* Skip preceding text and up to the next % sign. */
|
||||||
|
Loading…
Reference in New Issue
Block a user