This is an automated email from Gerrit.

Paul Fertser (fercer...@gmail.com) just uploaded a new patch set to Gerrit, 
which you can find at http://openocd.zylin.com/2524

-- gerrit

commit 07808ec72374bd45bf4f08dfee7226a302dc8f9e
Author: Paul Fertser <fercer...@gmail.com>
Date:   Sun Feb 1 22:19:38 2015 +0300

    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 <fercer...@gmail.com>

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;
        }

-- 

------------------------------------------------------------------------------
Dive into the World of Parallel Programming. The Go Parallel Website,
sponsored by Intel and developed in partnership with Slashdot Media, is your
hub for all things parallel software development, from weekly thought
leadership blogs to news, videos, case studies, tutorials and more. Take a
look and join the conversation now. http://goparallel.sourceforge.net/
_______________________________________________
OpenOCD-devel mailing list
OpenOCD-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to