From 861fc6431d34d916bde3ea8f0d61d57f1177a261 Mon Sep 17 00:00:00 2001 From: dsl Date: Mon, 9 Oct 2006 11:37:31 +0000 Subject: [PATCH] Fix core dump caused by non-zerod memory. From Auster in current_users. --- usr.bin/hexdump/parse.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index 6704e7cfa66b..1135bd10befe 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -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 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)parse.c 8.1 (Berkeley) 6/6/93"; #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 /* not lint */ @@ -227,7 +227,8 @@ rewrite(FS *fs) */ nextpr = &fu->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; /* Skip preceding text and up to the next % sign. */