diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c index c32a98d3339c..7d7d7a1bff23 100644 --- a/usr.sbin/inetd/builtins.c +++ b/usr.sbin/inetd/builtins.c @@ -480,6 +480,8 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */ ssize = read(s, &buf[size], (size_t)onreadlen); if (ssize == -1) iderror(0, 0, s, errno); + else if (ssize == 0) + break; bufsiz -= ssize; size += ssize; }