In io_callback() if we write the complete buffer and find that there
is no associated reader just return as there is nothing else to be done. In practice is it not possible for SUDO_EV_READ to be set if revent is NULL but an early return is harmless and possibly easier to understand. Coverity CID 104124.
This commit is contained in:
@@ -592,10 +592,11 @@ io_callback(int fd, int what, void *v)
|
|||||||
/* Reset buffer if fully consumed. */
|
/* Reset buffer if fully consumed. */
|
||||||
if (iob->off == iob->len) {
|
if (iob->off == iob->len) {
|
||||||
iob->off = iob->len = 0;
|
iob->off = iob->len = 0;
|
||||||
/* Forward the EOF from reader to writer. */
|
/* If reader is gone, close and remove writer; we are done. */
|
||||||
if (iob->revent == NULL) {
|
if (iob->revent == NULL) {
|
||||||
safe_close(fd);
|
safe_close(fd);
|
||||||
ev_free_by_fd(evbase, fd);
|
ev_free_by_fd(evbase, fd);
|
||||||
|
debug_return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* Re-enable writer if buffer is not empty. */
|
/* Re-enable writer if buffer is not empty. */
|
||||||
|
Reference in New Issue
Block a user