From 1909961a9bc21c4e68bf92af406fda9956078b5f Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Mon, 31 Jul 2000 21:37:29 +0000 Subject: [PATCH] Fix a bug in keyed sorting due to malloc abuse. Submitted by: green --- gnu/usr.bin/sort/sort.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c index f1976b4ff56..1b5b8b06b3c 100644 --- a/gnu/usr.bin/sort/sort.c +++ b/gnu/usr.bin/sort/sort.c @@ -19,6 +19,8 @@ The author may be reached (Email) at the address mike@gnu.ai.mit.edu, or (US mail) as Mike Haertel c/o Free Software Foundation. */ +/* $FreeBSD$ */ + #include /* Get isblank from GNU libc. */ @@ -1860,6 +1862,7 @@ main (int argc, char **argv) insertkey (key); key = (struct keyfield *) xmalloc (sizeof (struct keyfield)); + bzero(key, sizeof(*key)); key->eword = -1; key->ignore = NULL; key->translate = NULL;