summaryrefslogtreecommitdiffstats
path: root/meta/recipes-devtools/elfutils/files/0007-Fix-control-path-where-we-have-str-as-uninitialized-.patch
blob: 611a24c0f547e179f196683b2f5f1f6450df6c69 (plain)
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
From 112d1645bab7922c7796fe32ddea8fa6e1bbded1 Mon Sep 17 00:00:00 2001
From: Hongxu Jia <hongxu.jia@windriver.com>
Date: Fri, 29 Jun 2018 15:14:28 +0800
Subject: [PATCH] Fix control path where we have str as uninitialized string

|
/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:
In function 'i386_disasm':
|
/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:310:5:
error: 'str' may be used uninitialized in this function
[-Werror=maybe-uninitialized]
|      memcpy (buf + bufcnt, _str, _len);           \
|      ^
|
/home/ubuntu/work/oe/openembedded-core/build/tmp-musl/work/i586-oe-linux-musl/elfutils/0.164-r0/elfutils-0.164/libcpu/i386_disasm.c:709:17:
note: 'str' was declared here
|      const char *str;

Signed-off-by: Khem Raj <raj.khem@gmail.com>
Upstream-Status: Pending

Rebase to 0.172

Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>

---
 libcpu/i386_disasm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
index a7e03f9..837a3a8 100644
--- a/libcpu/i386_disasm.c
+++ b/libcpu/i386_disasm.c
@@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
 			    }
 			  FALLTHROUGH;
 			default:
+			  str = "";
 			  assert (! "INVALID not handled");
 			}
 		    }