From 0a822afbcdf6aee6c25a840e4785ad3af56a94fd Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Sat, 18 Jan 2014 19:25:57 -0700 Subject: don't let hexify call strlen hexify had the same issue as bin2hex; and the fix is the same. 2014-02-12 Tom Tromey * common/rsp-low.c (hexify): Never take strlen of argument. 2014-02-12 Tom Tromey * remote-utils.c (monitor_output): Pass explicit length to hexify. --- gdb/gdbserver/ChangeLog | 5 +++++ gdb/gdbserver/remote-utils.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) (limited to 'gdb/gdbserver') diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 7bf4a0f..35303df 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,5 +1,10 @@ 2014-02-12 Tom Tromey + * remote-utils.c (monitor_output): Pass explicit length to + hexify. + +2014-02-12 Tom Tromey + * tracepoint.c: Include rsp-low.h. * server.c: Include rsp-low.h. * remote-utils.h (convert_ascii_to_int, convert_int_to_ascii) diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index b835175..8fd7c4a 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -1558,10 +1558,11 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc) void monitor_output (const char *msg) { - char *buf = xmalloc (strlen (msg) * 2 + 2); + int len = strlen (msg); + char *buf = xmalloc (len * 2 + 2); buf[0] = 'O'; - hexify (buf + 1, msg, 0); + hexify (buf + 1, msg, len); putpkt (buf); free (buf); -- cgit v1.1