From: Daniel Jacobowitz Date: Thu, 1 Jun 2006 15:46:41 +0000 (+0000) Subject: * gdb/remote.c (remote_hostio_parse_result): Check for strtol X-Git-Tag: gdb-csl-symbian-6_4_50_20060226-9~1 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03e4ab7040cbd6ea0f62afec1dde4186cb212d3b;p=thirdparty%2Fbinutils-gdb.git * gdb/remote.c (remote_hostio_parse_result): Check for strtol errors. --- diff --git a/ChangeLog.csl b/ChangeLog.csl index 1087f4c9d85..727868fa789 100644 --- a/ChangeLog.csl +++ b/ChangeLog.csl @@ -1,3 +1,8 @@ +2006-06-01 Daniel Jacobowitz + + * gdb/remote.c (remote_hostio_parse_result): Check for strtol + errors. + 2006-06-01 Daniel Jacobowitz * gdb/doc/gdb.texinfo (Host I/O Packets): Mention explicit negative diff --git a/gdb/remote.c b/gdb/remote.c index 15954c015da..65ada04215d 100644 --- a/gdb/remote.c +++ b/gdb/remote.c @@ -6116,15 +6116,17 @@ remote_hostio_parse_result (char *buffer, int *retcode, if (buffer[0] != 'F') return -1; + errno = 0; *retcode = strtol (&buffer[1], &p, 16); - if (p == &buffer[1]) + if (errno != 0 || p == &buffer[1]) return -1; /* Check for ",errno". */ if (*p == ',') { + errno = 0; *remote_errno = strtol (p + 1, &p2, 16); - if (p + 1 == p2) + if (errno != 0 || p + 1 == p2) return -1; p = p2; }