blob: 611a24c0f547e179f196683b2f5f1f6450df6c69 [file] [log] [blame]
Brad Bishop19323692019-04-05 15:28:33 -04001From 112d1645bab7922c7796fe32ddea8fa6e1bbded1 Mon Sep 17 00:00:00 2001
Brad Bishopd7bf8c12018-02-25 22:55:05 -05002From: Hongxu Jia <hongxu.jia@windriver.com>
Brad Bishop1a4b7ee2018-12-16 17:11:34 -08003Date: Fri, 29 Jun 2018 15:14:28 +0800
Brad Bishop19323692019-04-05 15:28:33 -04004Subject: [PATCH] Fix control path where we have str as uninitialized string
Brad Bishopd7bf8c12018-02-25 22:55:05 -05005
6|
7/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:
8In function 'i386_disasm':
9|
10/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:
11error: 'str' may be used uninitialized in this function
12[-Werror=maybe-uninitialized]
13| memcpy (buf + bufcnt, _str, _len); \
14| ^
15|
16/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:
17note: 'str' was declared here
18| const char *str;
19
20Signed-off-by: Khem Raj <raj.khem@gmail.com>
21Upstream-Status: Pending
22
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080023Rebase to 0.172
Brad Bishopd7bf8c12018-02-25 22:55:05 -050024
25Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
Brad Bishop19323692019-04-05 15:28:33 -040026
Brad Bishopd7bf8c12018-02-25 22:55:05 -050027---
28 libcpu/i386_disasm.c | 1 +
29 1 file changed, 1 insertion(+)
30
31diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080032index a7e03f9..837a3a8 100644
Brad Bishopd7bf8c12018-02-25 22:55:05 -050033--- a/libcpu/i386_disasm.c
34+++ b/libcpu/i386_disasm.c
35@@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
36 }
Brad Bishop1a4b7ee2018-12-16 17:11:34 -080037 FALLTHROUGH;
Brad Bishopd7bf8c12018-02-25 22:55:05 -050038 default:
39+ str = "";
40 assert (! "INVALID not handled");
41 }
42 }