From: Brian Pane Date: Wed, 5 Dec 2001 01:34:00 +0000 (+0000) Subject: Fixed check for buffer overrun in ap_rgetline() X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e6403429373c6714520e4f1032cca91428519557;p=apache Fixed check for buffer overrun in ap_rgetline() git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@92324 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/server/protocol.c b/server/protocol.c index 9400901425..f71d7dfb67 100644 --- a/server/protocol.c +++ b/server/protocol.c @@ -257,7 +257,7 @@ AP_DECLARE(int) ap_rgetline(char **s, int n, request_rec *r, int fold) AP_DEBUG_ASSERT(!APR_BRIGADE_EMPTY(req_cfg->bb)); break; } - if (length - 1 < n) { + if (total + length - 1 < n) { if (!*s) { *s = apr_palloc(r->pool, length + 2); /* +2 for LF, null */ }