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/ip CID 1132782: Fix uninitialized vari...
details: https://anonhg.NetBSD.org/src/rev/efe21be17d14
branches: trunk
changeset: 791653:efe21be17d14
user: christos <christos%NetBSD.org@localhost>
date: Wed Nov 27 17:55:46 2013 +0000
description:
CID 1132782: Fix uninitialized variable
diffstat:
external/bsd/nvi/dist/ip/ip_funcs.c | 14 +++++++++++++-
1 files changed, 13 insertions(+), 1 deletions(-)
diffs (105 lines):
diff -r 58b46370822c -r efe21be17d14 external/bsd/nvi/dist/ip/ip_funcs.c
--- a/external/bsd/nvi/dist/ip/ip_funcs.c Wed Nov 27 17:53:00 2013 +0000
+++ b/external/bsd/nvi/dist/ip/ip_funcs.c Wed Nov 27 17:55:46 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ip_funcs.c,v 1.2 2013/11/22 15:52:05 christos Exp $ */
+/* $NetBSD: ip_funcs.c,v 1.3 2013/11/27 17:55:46 christos Exp $ */
/*-
* Copyright (c) 1996
* Keith Bostic. All rights reserved.
@@ -41,6 +41,7 @@
ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
ipb.code = SI_WADDSTR;
ipb.len1 = len * sizeof(CHAR_T);
ipb.str1 = __UNCONST(str);
@@ -70,6 +71,7 @@
* If ex isn't in control, it's the last line of the screen and
* it's a split screen, use inverse video.
*/
+ memset(&ipb, 0, sizeof(ipb));
iv = 0;
if (!F_ISSET(sp, SC_SCR_EXWROTE) &&
ipp->row == LASTLINE(sp) && IS_SPLIT(sp)) {
@@ -100,6 +102,7 @@
IP_BUF ipb;
IP_PRIVATE *ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
if (attribute == SA_ALTERNATE) {
if (on) F_SET(ipp, IP_ON_ALTERNATE);
else F_CLR(ipp, IP_ON_ALTERNATE);
@@ -137,6 +140,7 @@
IP_BUF ipb;
IP_PRIVATE *ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
ipb.code = SI_BELL;
return (vi_send(ipp->o_fd, NULL, &ipb));
@@ -154,6 +158,7 @@
IP_BUF ipb;
IP_PRIVATE *ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
switch (bval) {
case BUSY_ON:
ipb.code = SI_BUSY_ON;
@@ -206,6 +211,7 @@
/* Temporary hack until we can pass screen pointers
* or name screens
*/
+ memset(&ipb, 0, sizeof(ipb));
if (IS_VSPLIT(sp)) {
size_t x, y, spcnt;
int error;
@@ -264,6 +270,7 @@
* If the bottom line was in reverse video, rewrite it in normal
* video before it's scrolled.
*/
+ memset(&ipb, 0, sizeof(ipb));
if (!F_ISSET(sp, SC_SCR_EXWROTE) && IS_SPLIT(sp)) {
ipb.code = SI_REWRITE;
ipb.val1 = RLNO(sp, LASTLINE(sp));
@@ -316,6 +323,7 @@
IP_BUF ipb;
IP_PRIVATE *ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
ipb.code = SI_INSERTLN;
return (vi_send(ipp->o_fd, NULL, &ipb));
@@ -372,6 +380,7 @@
ipp->row = lno;
ipp->col = cno;
+ memset(&ipb, 0, sizeof(ipb));
ipb.code = SI_MOVE;
ipb.val1 = RLNO(sp, lno);
ipb.val2 = RCNO(sp, cno);
@@ -422,6 +431,7 @@
* structures at which we have absolutely no business whatsoever
* looking...
*/
+ memset(&ipb, 0, sizeof(ipb));
ipb.val1 = HMAP->lno;
ipb.val2 = TMAP->lno - HMAP->lno;
if (sp->ep != NULL && sp->ep->db != NULL)
@@ -453,6 +463,7 @@
IP_BUF ipb;
IP_PRIVATE *ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
ipb.code = SI_RENAME;
ipb.str1 = name;
ipb.len1 = name ? strlen(name) : 0;
@@ -471,6 +482,7 @@
IP_BUF ipb;
IP_PRIVATE *ipp = IPP(sp);
+ memset(&ipb, 0, sizeof(ipb));
ipb.code = SI_REPLY;
ipb.val1 = status;
ipb.str1 = msg == NULL ? "" : msg;
Home |
Main Index |
Thread Index |
Old Index