]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* gdb/remote.c (remote_hostio_parse_result): Check for strtol
authorDaniel Jacobowitz <drow@false.org>
Thu, 1 Jun 2006 15:46:41 +0000 (15:46 +0000)
committerDaniel Jacobowitz <drow@false.org>
Thu, 1 Jun 2006 15:46:41 +0000 (15:46 +0000)
errors.

ChangeLog.csl
gdb/remote.c

index 1087f4c9d85b4de48a34ba4e7864fa0195adcaec..727868fa7897de49fa755224cd55cf4e6fede5b1 100644 (file)
@@ -1,3 +1,8 @@
+2006-06-01  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       * gdb/remote.c (remote_hostio_parse_result): Check for strtol
+       errors.
+
 2006-06-01  Daniel Jacobowitz  <dan@codesourcery.com>
 
        * gdb/doc/gdb.texinfo (Host I/O Packets): Mention explicit negative
index 15954c015da4a75f8cdb687982b7da7c9921084e..65ada04215d7ba7f0201a8fbba9424b4f3264da6 100644 (file)
@@ -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;
     }