summaryrefslogtreecommitdiffstats
path: root/gnu
diff options
context:
space:
mode:
authorkris <kris@FreeBSD.org>2000-07-31 21:37:29 +0000
committerkris <kris@FreeBSD.org>2000-07-31 21:37:29 +0000
commit2056f8f13d35cf95008302a7106bd4d736494913 (patch)
tree3a13e9010f48ec6d5ca8b01281e0d43099b2de3e /gnu
parent49c864f5161c83827efedb958ef8627aa5a295d5 (diff)
downloadFreeBSD-src-2056f8f13d35cf95008302a7106bd4d736494913.zip
FreeBSD-src-2056f8f13d35cf95008302a7106bd4d736494913.tar.gz
Fix a bug in keyed sorting due to malloc abuse.
Submitted by: green
Diffstat (limited to 'gnu')
-rw-r--r--gnu/usr.bin/sort/sort.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/gnu/usr.bin/sort/sort.c b/gnu/usr.bin/sort/sort.c
index f1976b4..1b5b8b0 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 <config.h>
/* 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;
OpenPOWER on IntegriCloud