From 7ba4b2b378f84d19f90d34def8cc2fbdb17708b1 Mon Sep 17 00:00:00 2001 From: Joe Orton Date: Fri, 6 Jul 2012 07:42:32 +0000 Subject: [PATCH] * modules/ssl/ssl_util_ocsp.c (get_line): Don't set line[-1] to 0 when len == 0. Submitted by: Jim Meyering git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1358061 13f79535-47bb-0310-9956-ffa450edef68 --- docs/log-message-tags/next-number | 2 +- modules/ssl/ssl_util_ocsp.c | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/docs/log-message-tags/next-number b/docs/log-message-tags/next-number index f507750d3d..df39956ee9 100644 --- a/docs/log-message-tags/next-number +++ b/docs/log-message-tags/next-number @@ -1 +1 @@ -2321 +2322 diff --git a/modules/ssl/ssl_util_ocsp.c b/modules/ssl/ssl_util_ocsp.c index 94ef4cd0a9..e5c5e58da2 100644 --- a/modules/ssl/ssl_util_ocsp.c +++ b/modules/ssl/ssl_util_ocsp.c @@ -153,7 +153,13 @@ static char *get_line(apr_bucket_brigade *bbout, apr_bucket_brigade *bbin, return NULL; } - if (len && line[len-1] != APR_ASCII_LF) { + if (len == 0) { + ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c, APLOGNO(02321) + "empty response from OCSP server"); + return NULL; + } + + if (line[len-1] != APR_ASCII_LF) { ap_log_cerror(APLOG_MARK, APLOG_ERR, rv, c, APLOGNO(01979) "response header line too long from OCSP server"); return NULL;