public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: pty: Fix segfault caused when tcflush() is called.
Date: Mon, 22 Feb 2021 10:51:19 +0100	[thread overview]
Message-ID: <YDN+lx5V2I3W3bbw@calimero.vinschen.de> (raw)
In-Reply-To: <20210220224516.1740-1-takashi.yano@nifty.ne.jp>

On Feb 21 07:45, Takashi Yano via Cygwin-patches wrote:
> - After commit 253352e796ff9ec9a447e5375f5bc3e2b92b5293, mc (midnight
>   commander) crashes with segfault if the shell is bash. This is due
>   to NULL pointer access in read(). This patch fixes the issue.
>   Addresses::
>     https://cygwin.com/pipermail/cygwin/2021-February/247870.html
> ---
>  winsup/cygwin/fhandler_tty.cc | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/winsup/cygwin/fhandler_tty.cc b/winsup/cygwin/fhandler_tty.cc
> index d30041af1..3fcaa8277 100644
> --- a/winsup/cygwin/fhandler_tty.cc
> +++ b/winsup/cygwin/fhandler_tty.cc
> @@ -1474,8 +1474,11 @@ wait_retry:
>  out:
>    termios_printf ("%d = read(%p, %lu)", totalread, ptr, len);
>    len = (size_t) totalread;
> -  bool saw_eol = totalread > 0 && strchr ("\r\n", ptr0[totalread -1]);
> -  mask_switch_to_pcon_in (false, saw_eol);
> +  if (ptr0)
> +    { /* Not tcflush() */
> +      bool saw_eol = totalread > 0 && strchr ("\r\n", ptr0[totalread -1]);
> +      mask_switch_to_pcon_in (false, saw_eol);
> +    }
>  }
>  
>  int
> -- 
> 2.30.0

Pushed.

So, what do you think is the state of the console code, Takashi?
Shall we start a release cycle next week?


Thanks,
Corinna

  reply	other threads:[~2021-02-22  9:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-20 22:45 Takashi Yano
2021-02-22  9:51 ` Corinna Vinschen [this message]
2021-02-22 11:41   ` Takashi Yano
2021-02-22 13:28     ` Takashi Yano
2021-02-22 13:57       ` Corinna Vinschen
2021-02-22 13:57     ` Corinna Vinschen
2021-02-23 11:24       ` Thomas Wolff
2021-02-23 13:13         ` Takashi Yano
2021-02-23 13:33           ` Takashi Yano
2021-02-23 17:15             ` Thomas Wolff

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YDN+lx5V2I3W3bbw@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).