[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Re: [PATCH] Check tcgetattr return value in init/init.c
From:       Denys Vlasenko <vda.linux () googlemail ! com>
Date:       2019-12-02 15:36:03
Message-ID: CAK1hOcOdLckv02S8TMJ3EdwkzFmnrEvfJjAh9VcT+DJSz_kDDA () mail ! gmail ! com
[Download RAW message or body]

On Mon, Dec 2, 2019 at 12:22 PM Timur R. Mustafin
<Timur.R.Mustafin@mcst.ru> wrote:
>
> Hello, busybox developers!
>
> I found uninitialized variable use in set_sane_term().
> It calls tcgetattr() function that should set &tty structure, but tcgetattr() can fail.
> During a fail &tty structure stay uninitialized.

Yes.
However.
If tcgetattr() fails, tcsetattr() on the same tty will fail as well.
Thus, uninitialized structure we feed to it won't matter.

> Patch checks return values of tcgetattr(), tcsetattr()

ok,

> and makes set_sane_term() function error-returning.

Do we want that? This means that previously we accepted non-ttys too,
now we will disallow them.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic