Cygwin: pty: Fix a small bug in is_console_app().
- Previsouly, there was potential risk of buffer over run in is_console_app(). This patch fixes the issue.
This commit is contained in:
parent
58e981a5a4
commit
249f42d07a
|
@ -224,7 +224,7 @@ is_console_app (WCHAR *filename)
|
|||
ReadFile (h, buf, sizeof (buf), &n, 0);
|
||||
CloseHandle (h);
|
||||
char *p = (char *) memmem (buf, n, "PE\0\0", 4);
|
||||
if (p && p + id_offset <= buf + n)
|
||||
if (p && p + id_offset < buf + n)
|
||||
return p[id_offset] == '\003'; /* 02: GUI, 03: console */
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue