Closed paulo-erichsen closed 4 years ago
FYI changing the strncpy
to memcpy
seems to allow me to compile, but I'm not 100% sure this is the right fix
diff --git a/tacc.c b/tacc.c
index 510d399..2293629 100644
--- a/tacc.c
+++ b/tacc.c
@@ -388,7 +388,7 @@ int main(int argc, char **argv) {
utmpx.ut_type = USER_PROCESS;
utmpx.ut_pid = getpid();
xstrcpy(utmpx.ut_line, tty, sizeof(utmpx.ut_line));
- strncpy(utmpx.ut_id, tty + C_STRLEN("tty"), sizeof(utmpx.ut_id));
+ memcpy(utmpx.ut_id, tty + C_STRLEN("tty"), sizeof(utmpx.ut_id));
xstrcpy(utmpx.ut_host, "dialup", sizeof(utmpx.ut_host));
utmpx.ut_tv.tv_sec = tv.tv_sec;
utmpx.ut_tv.tv_usec = tv.tv_usec;
This is easily fixed by decreasing the string length as in sizeof(utmpx.ut_id) - 1
to account the the trailing zero.
This does not seem to compile in Arch Linux
autoreconf
configure
make