In the __mips__ case, make sure to copy the symbol structure and the
symbol name.

Signed-off-by: Arnaud Patard <[email protected]>
---
 breakpoints.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/breakpoints.c b/breakpoints.c
index ba3b060..2b77e02 100644
--- a/breakpoints.c
+++ b/breakpoints.c
@@ -123,8 +123,8 @@ enable_all_breakpoints(Process *proc) {
 					continue;
 				}
 				debug(2,"inserting bp %p %s",addr,sym->name);
-				new_sym=malloc(sizeof(*new_sym));
-				memcpy(new_sym,sym,sizeof(*new_sym));
+				new_sym=malloc(sizeof(*new_sym) + strlen(sym->name) + 1);
+				memcpy(new_sym,sym,sizeof(*new_sym) + strlen(sym->name) + 1);
 				new_sym->next=proc->list_of_symbols;
 				proc->list_of_symbols=new_sym;
 				insert_breakpoint(proc, addr, new_sym);
_______________________________________________
Ltrace-devel mailing list
[email protected]
http://lists.alioth.debian.org/mailman/listinfo/ltrace-devel

Reply via email to