Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 1 | From 8eb100b2e51be5d473b0748a223e2e7f61ec606c Mon Sep 17 00:00:00 2001 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 2 | From: Hongxu Jia <hongxu.jia@windriver.com> |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 3 | Date: Fri, 29 Jun 2018 15:14:28 +0800 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 4 | Subject: [PATCH 7/7] Fix control path where we have str as uninitialized |
| 5 | string |
| 6 | |
| 7 | | |
| 8 | /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: |
| 9 | In function 'i386_disasm': |
| 10 | | |
| 11 | /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: |
| 12 | error: 'str' may be used uninitialized in this function |
| 13 | [-Werror=maybe-uninitialized] |
| 14 | | memcpy (buf + bufcnt, _str, _len); \ |
| 15 | | ^ |
| 16 | | |
| 17 | /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: |
| 18 | note: 'str' was declared here |
| 19 | | const char *str; |
| 20 | |
| 21 | Signed-off-by: Khem Raj <raj.khem@gmail.com> |
| 22 | Upstream-Status: Pending |
| 23 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 24 | Rebase to 0.172 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 25 | |
| 26 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
| 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 |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 32 | index a7e03f9..837a3a8 100644 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 33 | --- a/libcpu/i386_disasm.c |
| 34 | +++ b/libcpu/i386_disasm.c |
| 35 | @@ -821,6 +821,7 @@ i386_disasm (Ebl *ebl __attribute__((unused)), |
| 36 | } |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 37 | FALLTHROUGH; |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 38 | default: |
| 39 | + str = ""; |
| 40 | assert (! "INVALID not handled"); |
| 41 | } |
| 42 | } |
| 43 | -- |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame^] | 44 | 2.7.4 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 45 | |