This is an automated email from Gerrit.

Matthias Blaicher ([email protected]) just uploaded a new patch set to 
Gerrit, which you can find at http://openocd.zylin.com/934

-- gerrit

commit e31d56b04b0c66e7cf2825fec9c1d06594415925
Author: Matthias Blaicher <[email protected]>
Date:   Sat Oct 27 16:00:12 2012 +0200

    rtos: Fix wrong size allocation linux_get_symbol_list_to_lookup
    
    linux_get_symbol_list_to_lookup allocates to few memory. On 64 bit
    systems the error did not show due to char* being twice its size,
    leaving accidentally enough space.
    
    This patch makes linux_get_symbol_list_to_lookup behave identical
    to all other RTOS.
    
    Change-Id: I290ea241fb20b65585c8be14609a92fdbd2a307d
    Signed-off-by: Matthias Blaicher <[email protected]>

diff --git a/src/rtos/linux.c b/src/rtos/linux.c
index ba65558..ec25377 100644
--- a/src/rtos/linux.c
+++ b/src/rtos/linux.c
@@ -322,11 +322,13 @@ static char *linux_symbol_list[] = {
        NULL
 };
 
+#define LINUX_NUM_SYMBOLS (sizeof(linux_symbol_list)/sizeof(char *))
+
 static int linux_get_symbol_list_to_lookup(symbol_table_elem_t *symbol_list[])
 {
        unsigned int i;
        *symbol_list = (symbol_table_elem_t *)
-               malloc(sizeof(symbol_table_elem_t) / sizeof(char *));
+               malloc(sizeof(symbol_table_elem_t) * LINUX_NUM_SYMBOLS);
 
        for (i = 0; i < sizeof(linux_symbol_list) / sizeof(char *); i++)
                (*symbol_list)[i].symbol_name = linux_symbol_list[i];

-- 

------------------------------------------------------------------------------
WINDOWS 8 is here. 
Millions of people.  Your app in 30 days.
Visit The Windows 8 Center at Sourceforge for all your go to resources.
http://windows8center.sourceforge.net/
join-generation-app-and-make-money-coding-fast/
_______________________________________________
OpenOCD-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openocd-devel

Reply via email to