From 83d02ed2931feecb3e13e86ce710c8e422193d45 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 12 Dec 2012 11:48:08 +0100 Subject: [PATCH] login: check lastlog lseek return code [coverity scan] Signed-off-by: Karel Zak --- login-utils/login.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/login-utils/login.c b/login-utils/login.c index 534da42507..a17083b5f8 100644 --- a/login-utils/login.c +++ b/login-utils/login.c @@ -506,7 +506,8 @@ static void log_lastlog(struct login_context *cxt) if (fd < 0) return; - lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET); + if (lseek(fd, (off_t) cxt->pwd->pw_uid * sizeof(ll), SEEK_SET) == -1) + return; /* * Print last log message -- 2.47.3