]> git.ipfire.org Git - thirdparty/shadow.git/commit
Fix is_my_tty() buffer overrun
authorAlejandro Colomar <alx@kernel.org>
Sun, 12 Mar 2023 23:41:00 +0000 (00:41 +0100)
committerIker Pedrosa <ikerpedrosam@gmail.com>
Tue, 28 Mar 2023 11:00:38 +0000 (13:00 +0200)
commite27ca530912c9386f2a60656b4a2b713521f82b1
tree3277c9c26cfcfabe21624eca843e7571fee23c05
parent664d361fa549a3be5a00607ec6723f95ce33c688
Fix is_my_tty() buffer overrun

*  libmisc/utmp.c (is_my_tty): Declare the parameter as a char array,
   not char *, as it is not necessarily null-terminated.
   Avoid a read overrun when reading 'tty', which comes from
   'ut_utname'.

Reported-by: Paul Eggert <eggert@cs.ucla.edu>
Co-developed-by: Paul Eggert <eggert@cs.ucla.edu>
Signed-off-by: Alejandro Colomar <alx@kernel.org>
Reviewed-by: Iker Pedrosa <ipedrosa@redhat.com>
libmisc/utmp.c