From: Todd C. Miller Date: Thu, 27 Jul 2017 17:36:10 +0000 (-0600) Subject: Quiet a coverity false positive. X-Git-Tag: SUDO_1_8_21^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=4b516229141cba8dd05e1b53f976861aec084116;p=sudo Quiet a coverity false positive. --- 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");