]> sourceware.org Git - newlib-cygwin.git/commitdiff
* syscalls.cc (getusershell): Fix buffer overrun (Coverity ID 59932).
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 19 May 2014 08:29:47 +0000 (08:29 +0000)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 19 May 2014 08:29:47 +0000 (08:29 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/syscalls.cc

index a34fe685041c77b64147d3edfe923657a76be6e3..823019d37f4925ee4e7be30f8827f397ef5016dd 100644 (file)
@@ -1,3 +1,7 @@
+2014-05-18  David Stacey  <drstacey@tiscali.co.uk>
+
+       * syscalls.cc (getusershell): Fix buffer overrun (Coverity ID 59932).
+
 2014-05-15  Corinna Vinschen  <corinna@vinschen.de>
 
        * external.cc (cygwin_internal): Use local name buffer instead of
index 3a8fabf6d19927c6156abef47b6e9e653bf4403c..de8cf119cc5d9e9da799408b8f8268e917301611 100644 (file)
@@ -4179,7 +4179,7 @@ getusershell ()
   /* Get each non-whitespace character as part of the shell path as long as
      it fits in buf. */
   for (buf_idx = 0;
-       ch != EOF && !isspace (ch) && buf_idx < PATH_MAX;
+       ch != EOF && !isspace (ch) && buf_idx < (PATH_MAX - 1);
        buf_idx++, ch = getc (shell_fp))
     buf[buf_idx] = ch;
   /* Skip any trailing non-whitespace character not fitting in buf.  If the
This page took 0.043635 seconds and 5 git commands to generate.