All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sami Kerola <kerolasa@iki.fi>
To: util-linux@vger.kernel.org
Cc: Sami Kerola <kerolasa@iki.fi>
Subject: [PATCH 1/4] last: fix format overflow
Date: Sat, 27 May 2017 19:24:06 +0100	[thread overview]
Message-ID: <20170527182409.13985-1-kerolasa@iki.fi> (raw)

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


             reply	other threads:[~2017-05-27 18:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-27 18:24 Sami Kerola [this message]
2017-05-27 18:24 ` [PATCH 2/4] libblkid: fix format overflow 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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170527182409.13985-1-kerolasa@iki.fi \
    --to=kerolasa@iki.fi \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.