Source-Changes-HG archive

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

[src/netbsd-1-4]: src/usr.bin/join pull up rev 1.16 from trunk (requested by ...



details:   https://anonhg.NetBSD.org/src/rev/e302d66ac87d
branches:  netbsd-1-4
changeset: 469486:e302d66ac87d
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sun Sep 26 02:11:25 1999 +0000

description:
pull up rev 1.16 from trunk (requested by tron):
  Fix incorrect array size in a call to memset(), and avoid a possible
  segmentation fault in a call to memmove().  Fixes PR#8184.

diffstat:

 usr.bin/join/join.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r f5661ccc13b1 -r e302d66ac87d usr.bin/join/join.c
--- a/usr.bin/join/join.c       Sun Sep 26 02:03:53 1999 +0000
+++ b/usr.bin/join/join.c       Sun Sep 26 02:11:25 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: join.c,v 1.15 1998/12/19 17:05:30 christos Exp $       */
+/*     $NetBSD: join.c,v 1.15.2.1 1999/09/26 02:11:25 cgd Exp $        */
 
 /*-
  * Copyright (c) 1991 The Regents of the University of California.
@@ -48,7 +48,7 @@
 #if 0
 static char sccsid[] = "from: @(#)join.c       5.1 (Berkeley) 11/18/91";
 #else
-__RCSID("$NetBSD: join.c,v 1.15 1998/12/19 17:05:30 christos Exp $");
+__RCSID("$NetBSD: join.c,v 1.15.2.1 1999/09/26 02:11:25 cgd Exp $");
 #endif
 #endif /* not lint */
 
@@ -317,7 +317,7 @@
                        if ((F->set = realloc(F->set,
                            F->setalloc * sizeof(LINE))) == NULL)
                                enomem();
-                       memset(F->set + cnt, 0, 100 * sizeof(LINE *));
+                       memset(F->set + cnt, 0, 100 * sizeof(LINE));
                }
                        
                /*
@@ -347,7 +347,7 @@
                            lp->linealloc * sizeof(char))) == NULL)
                                enomem();
                }
-               memmove(lp->line, bp, len+1);
+               memmove(lp->line, bp, len);
 
                /* Replace trailing newline, if it exists. */ 
                if (bp[len - 1] == '\n')



Home | Main Index | Thread Index | Old Index