]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
wall: make sure line is zero terminated
authorKarel Zak <kzak@redhat.com>
Wed, 3 Oct 2018 15:06:12 +0000 (17:06 +0200)
committerKarel Zak <kzak@redhat.com>
Wed, 3 Oct 2018 15:06:12 +0000 (17:06 +0200)
Signed-off-by: Karel Zak <kzak@redhat.com>
term-utils/wall.c

index f57c0835c310a257a600ad2a776da4b5a567ac4b..48e654ac662d3984f08e6b7274f15d680ba33659 100644 (file)
@@ -259,7 +259,7 @@ int main(int argc, char **argv)
                if (group_buf && !is_gr_member(utmpptr->ut_user, group_buf))
                        continue;
 
-               xstrncpy(line, utmpptr->ut_line, sizeof(utmpptr->ut_line));
+               mem2strcpy(line, utmpptr->ut_line, sizeof(utmpptr->ut_line), sizeof(line));
                if ((p = ttymsg(&iov, 1, line, timeout)) != NULL)
                        warnx("%s", p);
        }