]> code.ossystems Code Review - openembedded-core.git/blob
611a24c0f547e179f196683b2f5f1f6450df6c69
[openembedded-core.git] /
1 From 112d1645bab7922c7796fe32ddea8fa6e1bbded1 Mon Sep 17 00:00:00 2001
2 From: Hongxu Jia <hongxu.jia@windriver.com>
3 Date: Fri, 29 Jun 2018 15:14:28 +0800
4 Subject: [PATCH] Fix control path where we have str as uninitialized string
5
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:
8 In 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:
11 error: '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:
17 note: 'str' was declared here
18 |      const char *str;
19
20 Signed-off-by: Khem Raj <raj.khem@gmail.com>
21 Upstream-Status: Pending
22
23 Rebase to 0.172
24
25 Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com>
26
27 ---
28  libcpu/i386_disasm.c | 1 +
29  1 file changed, 1 insertion(+)
30
31 diff --git a/libcpu/i386_disasm.c b/libcpu/i386_disasm.c
32 index a7e03f9..837a3a8 100644
33 --- a/libcpu/i386_disasm.c
34 +++ b/libcpu/i386_disasm.c
35 @@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)),
36                             }
37                           FALLTHROUGH;
38                         default:
39 +                         str = "";
40                           assert (! "INVALID not handled");
41                         }
42                     }