aboutsummaryrefslogtreecommitdiffstats
path: root/debian/patches/420_uninitialized.patch
blob: d1ee41d890b736d3e8dae00f17a6aba9af32c41a (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
Subject: Fix a few harmless uninitialized variables
Author: Olaf Hering <olh@suse.de>
Origin: https://build.opensuse.org/package/view_file/openSUSE:Factory/w3m/w3m-uninitialized.patch?expand=1

diff --git a/anchor.c b/anchor.c
index 39f221d..a353bb9 100644
--- a/anchor.c
+++ b/anchor.c
@@ -11,7 +11,7 @@ putAnchor(AnchorList *al, char *url, char *target, Anchor **anchor_return,
 {
     int n, i, j;
     Anchor *a;
-    BufferPoint bp;
+    BufferPoint bp = { 0 };
     if (al == NULL) {
 	al = New(AnchorList);
 	al->anchors = NULL;
diff --git a/libwc/gb18030.c b/libwc/gb18030.c
index c195d49..d5c9018 100644
--- a/libwc/gb18030.c
+++ b/libwc/gb18030.c
@@ -151,6 +151,7 @@ wc_ucs_to_gb18030(wc_uint32 ucs)
 	return cc;
     }
     cc.ccs = WC_CCS_UNKNOWN;
+    cc.code = 0;
     return cc;
 }
 #endif
diff --git a/libwc/ucs.c b/libwc/ucs.c
index d7b6948..5e78b4e 100644
--- a/libwc/ucs.c
+++ b/libwc/ucs.c
@@ -100,6 +100,7 @@ wc_ucs_to_any(wc_uint32 ucs, wc_table *t)
 	    return t->conv(t->ccs, map->code2);
     }
     cc.ccs = WC_CCS_UNKNOWN;
+    cc.code = 0;
     return cc;
 }
 
diff --git a/regex.c b/regex.c
index 5bee4b2..5675d09 100644
--- a/regex.c
+++ b/regex.c
@@ -77,7 +77,7 @@ static longchar
 set_longchar(char *str)
 {
     unsigned char *p = (unsigned char *)str;
-    longchar r;
+    longchar r = { };
 
 #ifdef USE_M17N
     if (*p & 0x80) {