aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/remote-utils.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2014-01-18 19:25:57 -0700
committerTom Tromey <tromey@redhat.com>2014-02-12 09:59:16 -0700
commit0a822afbcdf6aee6c25a840e4785ad3af56a94fd (patch)
tree169393d7a5cc2a03aafa5c26ea3e4239c00a9386 /gdb/gdbserver/remote-utils.c
parent9f1b45b0da430a7a7abf9e54acbe6f2ef9d3a763 (diff)
downloadgdb-0a822afbcdf6aee6c25a840e4785ad3af56a94fd.zip
gdb-0a822afbcdf6aee6c25a840e4785ad3af56a94fd.tar.gz
gdb-0a822afbcdf6aee6c25a840e4785ad3af56a94fd.tar.bz2
don't let hexify call strlen
hexify had the same issue as bin2hex; and the fix is the same. 2014-02-12 Tom Tromey <tromey@redhat.com> * common/rsp-low.c (hexify): Never take strlen of argument. 2014-02-12 Tom Tromey <tromey@redhat.com> * remote-utils.c (monitor_output): Pass explicit length to hexify.
Diffstat (limited to 'gdb/gdbserver/remote-utils.c')
-rw-r--r--gdb/gdbserver/remote-utils.c5
1 files changed, 3 insertions, 2 deletions
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);