summaryrefslogtreecommitdiffstats
path: root/login-utils/last.c
diff options
context:
space:
mode:
authorSami Kerola2011-09-10 16:49:58 +0200
committerSami Kerola2011-09-10 16:49:58 +0200
commit889f1215f60d043f026c3134d0ae1a0312319f6e (patch)
treeb1fd225f197a923485921f05124aae682cd2ff57 /login-utils/last.c
parentlibblkid: fix smatch warning (diff)
downloadkernel-qcow2-util-linux-889f1215f60d043f026c3134d0ae1a0312319f6e.tar.gz
kernel-qcow2-util-linux-889f1215f60d043f026c3134d0ae1a0312319f6e.tar.xz
kernel-qcow2-util-linux-889f1215f60d043f026c3134d0ae1a0312319f6e.zip
last: fix smatch warning
login-utils/last.c +447 ttyconv(11) error: buffer overflow '(arg)' 3 <= 3 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'login-utils/last.c')
-rw-r--r--login-utils/last.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/login-utils/last.c b/login-utils/last.c
index 23a2d28cc..598078045 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -448,7 +448,7 @@ ttyconv(char *arg) {
(void)strcpy(mval, "console");
else {
(void)strcpy(mval, "tty");
- (void)strcpy(mval + 3, arg);
+ (void)strncpy(mval + 3, arg, 4);
}
return mval;
}