Source-Changes-HG archive

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

[src/trunk]: src/usr.sbin/sushi launch_subwin(): make sure string 'command' i...



details:   https://anonhg.NetBSD.org/src/rev/2a1b75d4e84f
branches:  trunk
changeset: 534413:2a1b75d4e84f
user:      jdolecek <jdolecek%NetBSD.org@localhost>
date:      Thu Jul 25 12:34:09 2002 +0000

description:
launch_subwin(): make sure string 'command' is initialized; malloc may not return
zeroed memory. This should fix the SIGSEGV part of bin/17718
by Grant Beattie.

diffstat:

 usr.sbin/sushi/run.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diffs (17 lines):

diff -r 046441f01978 -r 2a1b75d4e84f usr.sbin/sushi/run.c
--- a/usr.sbin/sushi/run.c      Thu Jul 25 12:20:56 2002 +0000
+++ b/usr.sbin/sushi/run.c      Thu Jul 25 12:34:09 2002 +0000
@@ -1,4 +1,4 @@
-/*      $NetBSD: run.c,v 1.5 2002/04/02 18:57:01 christos Exp $       */
+/*      $NetBSD: run.c,v 1.6 2002/07/25 12:34:09 jdolecek Exp $       */
 
 /*
  * Copyright (c) 2000 The NetBSD Foundation, Inc.
@@ -132,6 +132,7 @@
        x = -1; /* we inc x before using it */
 
        command = (char *)malloc(MAXBUF * sizeof(char));
+       command[0] = '\0';
        for (p = *args; p != NULL; p = *++args) {
                strcat(command, p);
                strcat(command, " ");



Home | Main Index | Thread Index | Old Index