Kernel: Zero initialize winsize in TIOCGWINSZ

It looks like type types are small enough that there is no padding.
So there didn't happen to be an info leak here, but lets zero initialize
just to be on the safe side, and make auditing easier.
This commit is contained in:
Brian Gianforcaro 2021-12-29 02:59:44 -08:00 committed by Brian Gianforcaro
parent 737a11389c
commit dee0c004e0
Notes: sideshowbarker 2024-07-17 22:00:18 +09:00

View File

@ -543,7 +543,7 @@ ErrorOr<void> TTY::ioctl(OpenFileDescription&, unsigned request, Userspace<void*
}
case TIOCGWINSZ: {
auto user_winsize = static_ptr_cast<winsize*>(arg);
winsize ws;
winsize ws {};
ws.ws_row = m_rows;
ws.ws_col = m_columns;
ws.ws_xpixel = 0;