Cygwin: pty: Fix a bug in tty_min::segpgid().
- In tty_min::setpgid(), a pointer to fhandler instance is casted to fhandler_pty_slave and accessed even if terminal is not a pty slave. This patch fixes the issue.
This commit is contained in:
parent
c4704c7c20
commit
bed1add783
|
@ -309,7 +309,8 @@ tty_min::setpgid (int pid)
|
||||||
fhandler_pty_slave *ptys = NULL;
|
fhandler_pty_slave *ptys = NULL;
|
||||||
cygheap_fdenum cfd (false);
|
cygheap_fdenum cfd (false);
|
||||||
while (cfd.next () >= 0 && ptys == NULL)
|
while (cfd.next () >= 0 && ptys == NULL)
|
||||||
if (cfd->get_device () == getntty ())
|
if (cfd->get_device () == getntty ()
|
||||||
|
&& cfd->get_major () == DEV_PTYS_MAJOR)
|
||||||
ptys = (fhandler_pty_slave *) (fhandler_base *) cfd;
|
ptys = (fhandler_pty_slave *) (fhandler_base *) cfd;
|
||||||
|
|
||||||
if (ptys)
|
if (ptys)
|
||||||
|
|
Loading…
Reference in New Issue