Commit c0c6185
Cygwin: is_console_app(): do handle errors
When that function was introduced in bb42852 (Cygwin: pty: Implement
new pseudo console support., 2020-08-19) (back then, it was added to
`spawn.cc`, later it was moved to `fhandler/termios.cc` in 32d6a6c
(Cygwin: pty, console: Encapsulate spawn.cc code related to
pty/console., 2022-11-19)), it was implemented with strong assumptions
that neither creating the file handle nor reading 1024 bytes from said
handle could fail.
This assumption, however, is incorrect. Concretely, I encountered the
case where `is_console_app()` needed to open an app execution alias,
failed to do so, and still tried to read from the invalid handle.
Let's add some error handling to that function.
Fixes: bb42852 (Cygwin: pty: Implement new pseudo console support., 2020-08-19)
Co-authored-by: Takashi Yano <takashi.yano@nifty.ne.jp>
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
(cherry picked from commit c9b98d2e553b5d3c08b597ec1c84b7ccf0a249fe)1 parent 97d254c commit c0c6185
1 file changed
+5
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
707 | 707 | | |
708 | 708 | | |
709 | 709 | | |
| 710 | + | |
| 711 | + | |
710 | 712 | | |
711 | 713 | | |
712 | | - | |
| 714 | + | |
713 | 715 | | |
| 716 | + | |
| 717 | + | |
714 | 718 | | |
715 | 719 | | |
716 | 720 | | |
| |||
0 commit comments