Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/msgc don't dereference NULL when thinking about copy...



details:   https://anonhg.NetBSD.org/src/rev/b8f5eb508696
branches:  trunk
changeset: 473778:b8f5eb508696
user:      cgd <cgd%NetBSD.org@localhost>
date:      Sat Jun 19 00:40:29 1999 +0000

description:
don't dereference NULL when thinking about copying the default

diffstat:

 usr.bin/msgc/msg_sys.def |  4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diffs (18 lines):

diff -r d02d6103449f -r b8f5eb508696 usr.bin/msgc/msg_sys.def
--- a/usr.bin/msgc/msg_sys.def  Sat Jun 19 00:13:19 1999 +0000
+++ b/usr.bin/msgc/msg_sys.def  Sat Jun 19 00:40:29 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: msg_sys.def,v 1.4 1999/06/19 00:13:19 cgd Exp $        */
+/*     $NetBSD: msg_sys.def,v 1.5 1999/06/19 00:40:29 cgd Exp $        */
 
 /*
  * Copyright 1997 Piermont Information Systems Inc.
@@ -183,7 +183,7 @@
        if (count != 0) {
                ibuf[count] = '\0';
                strcpy(val, ibuf);              /* size known to be OK */
-       } else if (val != def) {
+       } else if (def != NULL && val != def) {
                strncpy(val, def, max_chars);
                val[max_chars - 1] = '\0';
        }



Home | Main Index | Thread Index | Old Index