diff options
| author | David Malone <dwmalone@FreeBSD.org> | 2001-03-28 13:41:19 +0000 |
|---|---|---|
| committer | David Malone <dwmalone@FreeBSD.org> | 2001-03-28 13:41:19 +0000 |
| commit | d517199f441eacc48f19b53ab1c526f4689d6ee3 (patch) | |
| tree | 5f6affa4c9808b04291671f4a4169985ffde6ea5 | |
| parent | a74da62e7031ffc52a4e15ab127fa0e5c826b097 (diff) | |
Notes
| -rw-r--r-- | usr.sbin/inetd/builtins.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/inetd/builtins.c b/usr.sbin/inetd/builtins.c index 00839327991b..ad0160bd5c3a 100644 --- a/usr.sbin/inetd/builtins.c +++ b/usr.sbin/inetd/builtins.c @@ -464,7 +464,7 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */ size = 0; bufsiz = sizeof(buf) - 1; FD_ZERO(&fdset); - while (bufsiz > 0 && (size == 0 || buf[size - 1] != '\n')) { + while (bufsiz > 0) { gettimeofday(&tv, NULL); tv.tv_sec = to.tv_sec - tv.tv_sec; tv.tv_usec = to.tv_usec - tv.tv_usec; @@ -488,6 +488,8 @@ ident_stream(s, sep) /* Ident service (AKA "auth") */ break; bufsiz -= ssize; size += ssize; + if (memchr(&buf[size - ssize], '\n', ssize) != NULL) + break; } buf[size] = '\0'; /* Read two characters, and check for a delimiting character */ |
