Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 1 | From 112d1645bab7922c7796fe32ddea8fa6e1bbded1 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 | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 4 | Subject: [PATCH] Fix control path where we have str as uninitialized string |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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 | |
Brad Bishop | 1a4b7ee | 2018-12-16 17:11:34 -0800 | [diff] [blame] | 23 | Rebase to 0.172 |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 24 | |
| 25 | Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> |
Brad Bishop | 1932369 | 2019-04-05 15:28:33 -0400 | [diff] [blame] | 26 | |
Brad Bishop | d7bf8c1 | 2018-02-25 22:55:05 -0500 | [diff] [blame] | 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 | } |