From: Steve Grubb Date: Fri, 18 Mar 2022 19:35:02 +0000 (-0400) Subject: Change to strncat X-Git-Tag: 4.12~54 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4f393a5f9fd9168c91225ae1b39843fc90372c74;p=thirdparty%2Fshadow.git Change to strncat ut_line is declared as a nonstring in bits/utmp.h. It might not be NUL terminated. Limit how much it copies to the size of the array. --- diff --git a/src/logoutd.c b/src/logoutd.c index d369acf45..03680f3f3 100644 --- a/src/logoutd.c +++ b/src/logoutd.c @@ -228,7 +228,7 @@ int main (int argc, char **argv) tty_name[0] = '\0'; } - strcat (tty_name, ut->ut_line); + strncat (tty_name, ut->ut_line, UT_LINESIZE); #ifndef O_NOCTTY #define O_NOCTTY 0 #endif