From 4b516229141cba8dd05e1b53f976861aec084116 Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Thu, 27 Jul 2017 11:36:10 -0600 Subject: [PATCH] Quiet a coverity false positive. --- plugins/sudoers/sudoreplay.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/plugins/sudoers/sudoreplay.c b/plugins/sudoers/sudoreplay.c index f4ea7ce50..468f426cc 100644 --- a/plugins/sudoers/sudoreplay.c +++ b/plugins/sudoers/sudoreplay.c @@ -484,7 +484,8 @@ getsize_cb(int fd, int what, void *v) goto done; } if (ISSET(gc->state, READCHAR)) { - switch (read(ttyfd, &ch, 1)) { + ssize_t nread = read(ttyfd, &ch, 1); + switch (nread) { case -1: if (errno == EAGAIN) goto another; @@ -1619,10 +1620,12 @@ read_keyboard(int fd, int what, void *v) struct replay_closure *closure = v; static bool paused = false; struct timeval tv; + ssize_t nread; char ch; debug_decl(read_keyboard, SUDO_DEBUG_UTIL) - switch (read(fd, &ch, 1)) { + nread = read(fd, &ch, 1); + switch (nread) { case -1: if (errno != EINTR && errno != EAGAIN) sudo_fatal(U_("unable to read %s"), "stdin"); -- 2.40.0