mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-22 11:00:01 +08:00
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.
This commit is contained in:
@ -1,3 +1,7 @@
|
|||||||
|
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>
|
2014-02-12 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* common/rsp-low.c (bin2hex): Never take strlen of argument.
|
* common/rsp-low.c (bin2hex): Never take strlen of argument.
|
||||||
|
@ -177,10 +177,6 @@ hexify (char *hex, const char *bin, int count)
|
|||||||
{
|
{
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
/* May use a length, or a nul-terminated string as input. */
|
|
||||||
if (count == 0)
|
|
||||||
count = strlen (bin);
|
|
||||||
|
|
||||||
for (i = 0; i < count; i++)
|
for (i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
*hex++ = tohex ((*bin >> 4) & 0xf);
|
*hex++ = tohex ((*bin >> 4) & 0xf);
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2014-02-12 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
|
* remote-utils.c (monitor_output): Pass explicit length to
|
||||||
|
hexify.
|
||||||
|
|
||||||
2014-02-12 Tom Tromey <tromey@redhat.com>
|
2014-02-12 Tom Tromey <tromey@redhat.com>
|
||||||
|
|
||||||
* tracepoint.c: Include rsp-low.h.
|
* tracepoint.c: Include rsp-low.h.
|
||||||
|
@ -1558,10 +1558,11 @@ relocate_instruction (CORE_ADDR *to, CORE_ADDR oldloc)
|
|||||||
void
|
void
|
||||||
monitor_output (const char *msg)
|
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';
|
buf[0] = 'O';
|
||||||
hexify (buf + 1, msg, 0);
|
hexify (buf + 1, msg, len);
|
||||||
|
|
||||||
putpkt (buf);
|
putpkt (buf);
|
||||||
free (buf);
|
free (buf);
|
||||||
|
Reference in New Issue
Block a user