diff --git a/lib/isc/httpd.c b/lib/isc/httpd.c index de6b380e97..fbf9a063ee 100644 --- a/lib/isc/httpd.c +++ b/lib/isc/httpd.c @@ -401,12 +401,13 @@ have_header(isc_httpd_t *httpd, const char *header, const char *value, if (cr != NULL && cr[1] == '\n') cr++; nl = strchr(h, '\n'); + /* last header? */ - if (cr == NULL && nl == NULL) - return(ISC_FALSE); h = cr; - if (h == NULL || nl < h) + if (h == NULL || (nl != NULL && nl < h)) h = nl; + if (h == NULL) + return (ISC_FALSE); h++; continue; }