Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/sort make sure to initialize malloc'ed region. PR 1...



details:   https://anonhg.NetBSD.org/src/rev/434662bbdd42
branches:  trunk
changeset: 503413:434662bbdd42
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Feb 05 14:25:34 2001 +0000

description:
make sure to initialize malloc'ed region.  PR 12138.  found by malloc.conf=AJ

diffstat:

 usr.bin/sort/fsort.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (26 lines):

diff -r 0e771058ec5e -r 434662bbdd42 usr.bin/sort/fsort.c
--- a/usr.bin/sort/fsort.c      Mon Feb 05 13:34:42 2001 +0000
+++ b/usr.bin/sort/fsort.c      Mon Feb 05 14:25:34 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: fsort.c,v 1.11 2001/01/19 10:13:21 jdolecek Exp $      */
+/*     $NetBSD: fsort.c,v 1.12 2001/02/05 14:25:34 itojun Exp $        */
 
 /*-
  * Copyright (c) 1993
@@ -47,7 +47,7 @@
 #include "fsort.h"
 
 #ifndef lint
-__RCSID("$NetBSD: fsort.c,v 1.11 2001/01/19 10:13:21 jdolecek Exp $");
+__RCSID("$NetBSD: fsort.c,v 1.12 2001/02/05 14:25:34 itojun Exp $");
 __SCCSID("@(#)fsort.c  8.1 (Berkeley) 6/6/93");
 #endif /* not lint */
 
@@ -96,6 +96,7 @@
        if (!buffer) {
                buffer = malloc(bufsize);
                keylist = malloc(MAXNUM * sizeof(u_char *));
+               memset(keylist, 0, MAXNUM * sizeof(u_char *));
                if (!SINGL_FLD) {
                        linebuf_size = DEFLLEN;
                        linebuf = malloc(linebuf_size);



Home | Main Index | Thread Index | Old Index