All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/4] last: fix format overflow
@ 2017-05-27 18:24 Sami Kerola
  2017-05-27 18:24 ` [PATCH 2/4] libblkid: " Sami Kerola
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Sami Kerola @ 2017-05-27 18:24 UTC (permalink / raw)
  To: util-linux; +Cc: Sami Kerola

login-utils/last.c:624:23: warning: '%s' directive writing up to 31 bytes
into a region of size 27 [-Wformat-overflow=]

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
---
 login-utils/last.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/login-utils/last.c b/login-utils/last.c
index 679ea6c12..153130ac0 100644
--- a/login-utils/last.c
+++ b/login-utils/last.c
@@ -598,7 +598,7 @@ static void __attribute__((__noreturn__)) usage(const struct last_control *ctl,
 static int is_phantom(const struct last_control *ctl, struct utmpx *ut)
 {
 	struct passwd *pw;
-	char path[32];
+	char path[sizeof("/dev/") + sizeof(ut->ut_line) + 1];
 	int ret = 0;
 
 	if (ut->ut_tv.tv_sec < ctl->boot_time.tv_sec)
-- 
2.13.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2017-06-14 10:09 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-05-27 18:24 [PATCH 1/4] last: fix format overflow Sami Kerola
2017-05-27 18:24 ` [PATCH 2/4] libblkid: " Sami Kerola
2017-05-27 18:24 ` [PATCH 3/4] lib/loopdev: " Sami Kerola
2017-05-27 18:24 ` [PATCH 4/4] lib/sysfs: " Sami Kerola
2017-05-29 10:09   ` Karel Zak
2017-05-29 14:06     ` Sami Kerola
2017-05-31 19:28       ` Yuriy M. Kaminskiy
2017-06-01  8:40         ` Karel Zak
2017-06-14 10:09 ` [PATCH 1/4] last: " Karel Zak

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.