Source-Changes-HG archive

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

[src/trunk]: src/external/bsd/nvi/dist/ipc CID 1132786: Fix uninitialized var...



details:   https://anonhg.NetBSD.org/src/rev/9a3d9b4db069
branches:  trunk
changeset: 791650:9a3d9b4db069
user:      christos <christos%NetBSD.org@localhost>
date:      Wed Nov 27 17:48:21 2013 +0000

description:
CID 1132786: Fix uninitialized variable

diffstat:

 external/bsd/nvi/dist/ipc/ipc_method.c |  10 +++++++++-
 1 files changed, 9 insertions(+), 1 deletions(-)

diffs (59 lines):

diff -r f1597711d869 -r 9a3d9b4db069 external/bsd/nvi/dist/ipc/ipc_method.c
--- a/external/bsd/nvi/dist/ipc/ipc_method.c    Wed Nov 27 17:38:11 2013 +0000
+++ b/external/bsd/nvi/dist/ipc/ipc_method.c    Wed Nov 27 17:48:21 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ipc_method.c,v 1.2 2013/11/22 15:52:05 christos Exp $  */
+/*     $NetBSD: ipc_method.c,v 1.3 2013/11/27 17:48:21 christos Exp $  */
 /*-
  * Copyright (c) 1996
  *     Rob Zimmermann.  All rights reserved.
@@ -182,6 +182,8 @@
 vi_send_(IPVIWIN *ipvi, int code)
 {
        IP_BUF  ipb;
+
+       memset(&ipb, 0, sizeof(ipb));
        ipb.code = code;
        return vi_send(ipvi->ofd, NULL, &ipb);
 }
@@ -190,6 +192,8 @@
 vi_send_1(IPVIWIN *ipvi, int code, u_int32_t val)
 {
        IP_BUF  ipb;
+
+       memset(&ipb, 0, sizeof(ipb));
        ipb.code = code;
        ipb.val1 = val;
        return vi_send(ipvi->ofd, "1", &ipb);
@@ -200,6 +204,7 @@
 {
        IP_BUF  ipb;
 
+       memset(&ipb, 0, sizeof(ipb));
        ipb.val1 = val1;
        ipb.val2 = val2;
        ipb.code = code;
@@ -211,6 +216,7 @@
 {
        IP_BUF  ipb;
 
+       memset(&ipb, 0, sizeof(ipb));
        ipb.str1 = str;
        ipb.len1 = len;
        ipb.code = code;
@@ -224,6 +230,7 @@
 {
        IP_BUF  ipb;
 
+       memset(&ipb, 0, sizeof(ipb));
        ipb.str1 = str;
        ipb.len1 = len;
        ipb.val1 = val;
@@ -237,6 +244,7 @@
 {
        IP_BUF  ipb;
 
+       memset(&ipb, 0, sizeof(ipb));
        ipb.str1 = str1;
        ipb.len1 = len1;
        ipb.str2 = str2;



Home | Main Index | Thread Index | Old Index