* syscalls.cc (getusershell): Fix buffer overrun (Coverity ID 59932).
This commit is contained in:
parent
eec106c4ec
commit
8c14a5065d
@ -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>
|
2014-05-15 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* external.cc (cygwin_internal): Use local name buffer instead of
|
* external.cc (cygwin_internal): Use local name buffer instead of
|
||||||
|
@ -4179,7 +4179,7 @@ getusershell ()
|
|||||||
/* Get each non-whitespace character as part of the shell path as long as
|
/* Get each non-whitespace character as part of the shell path as long as
|
||||||
it fits in buf. */
|
it fits in buf. */
|
||||||
for (buf_idx = 0;
|
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_idx++, ch = getc (shell_fp))
|
||||||
buf[buf_idx] = ch;
|
buf[buf_idx] = ch;
|
||||||
/* Skip any trailing non-whitespace character not fitting in buf. If the
|
/* Skip any trailing non-whitespace character not fitting in buf. If the
|
||||||
|
Loading…
x
Reference in New Issue
Block a user