]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
* remote-fileio.c (remote_fileio_func_read): Limit console gdb-csl-sourcerygxx-4_1-8
authorDaniel Jacobowitz <drow@false.org>
Sat, 10 Jun 2006 17:56:57 +0000 (17:56 +0000)
committerDaniel Jacobowitz <drow@false.org>
Sat, 10 Jun 2006 17:56:57 +0000 (17:56 +0000)
reads to 8K.

ChangeLog.csl
gdb/remote-fileio.c

index bf3c87b7f0363f366ecd88ab82dadce418b55dd0..aace2ccdac628af840a68f27a7a2cad83967fc0c 100644 (file)
@@ -1,3 +1,10 @@
+2006-06-10  Daniel Jacobowitz  <dan@codesourcery.com>
+
+       Issue #669
+       gdb/
+       * remote-fileio.c (remote_fileio_func_read): Limit console
+       reads to 8K.
+
 2006-06-09  Nathan Sidwell  <nathan@codesourcery.com>
 
        gdb/testsuite/
index 952c31875abfabaed9da1d990473b30fc17632d2..e8195279635895e2a0c9903735a8231cf67e05e5 100644 (file)
@@ -751,7 +751,16 @@ remote_fileio_func_read (char *buf)
            }
          else
            {
-             ret = ui_file_read (gdb_stdtargin, (char *) buffer, 32767);
+             /* NOTE drow/2006-06-10: Windows (mingw32) has a truly
+                bizarre bug.  If a handle is backed by a real console
+                device, overly large reads from the console will fail
+                and set errno == ENOMEM.  On a Windows Server 2003
+                system where I tested, reading 26608 bytes from the
+                console was OK, but anything about 26609 bytes would
+                fail.  So, we limit this read to something smaller
+                than that - by a safe margin, in case the limit
+                depends on system resources or version.  */
+             ret = ui_file_read (gdb_stdtargin, (char *) buffer, 8191);
              remote_fio_no_longjmp = 1;
              if (ret > 0 && (size_t)ret > length)
                {