diff options
author | Paul Fertser <fercerpav@gmail.com> | 2015-02-01 22:19:38 +0300 |
---|---|---|
committer | Paul Fertser <fercerpav@gmail.com> | 2015-02-11 15:34:11 +0000 |
commit | c8d351b1bf592046cef7dc48d84eb10a1ba93993 (patch) | |
tree | 83152911c11ae6c1550ded09e7f25dfbef17ee59 /src/target | |
parent | 7f000f824bb405d3985256b123f3e4b55dc43b6b (diff) | |
download | riscv-openocd-c8d351b1bf592046cef7dc48d84eb10a1ba93993.zip riscv-openocd-c8d351b1bf592046cef7dc48d84eb10a1ba93993.tar.gz riscv-openocd-c8d351b1bf592046cef7dc48d84eb10a1ba93993.tar.bz2 |
target/image: fix undefined behaviour when loading with GDB
The image struct is malloc'd and hence base_address_set doesn't have a
defined value.
Caught by Valgrind.
Change-Id: Ice15b2299fc768e44e8034eeb93e035076eacd03
Signed-off-by: Paul Fertser <fercerpav@gmail.com>
Reviewed-on: http://openocd.zylin.com/2524
Tested-by: jenkins
Reviewed-by: Stian Skjelstad <stian@nixia.no>
Reviewed-by: Spencer Oliver <spen@spen-soft.co.uk>
Diffstat (limited to 'src/target')
-rw-r--r-- | src/target/image.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/target/image.c b/src/target/image.c index 07420b1..b1b7e3a 100644 --- a/src/target/image.c +++ b/src/target/image.c @@ -788,6 +788,7 @@ int image_open(struct image *image, const char *url, const char *type_string) } } else if (image->type == IMAGE_BUILDER) { image->num_sections = 0; + image->base_address_set = 0; image->sections = NULL; image->type_private = NULL; } |