summaryrefslogtreecommitdiffstats
path: root/server
diff options
context:
space:
mode:
authorRuediger Pluem <rpluem@apache.org>2006-04-14 14:17:54 +0200
committerRuediger Pluem <rpluem@apache.org>2006-04-14 14:17:54 +0200
commit4d1b38642dcdf1408a84b58f0ba33504097b6d3e (patch)
tree85e3da9fa63860acb794a85c274d0c83cb395864 /server
parent* After r377780 the condition in the if clause never becomes true, because (diff)
downloadapache2-4d1b38642dcdf1408a84b58f0ba33504097b6d3e.tar.xz
apache2-4d1b38642dcdf1408a84b58f0ba33504097b6d3e.zip
* Initialize last_char as otherwise a random value will be compared
against APR_ASCII_LF at the end of the loop if bb only contains an EOS bucket. PR: 39282 Submitted by: Davi Arnaut <davi haxent.com.br> Reviewed by: rpluem git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@394070 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'server')
-rw-r--r--server/protocol.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/server/protocol.c b/server/protocol.c
index 9f792ecce2..74cfb9cf63 100644
--- a/server/protocol.c
+++ b/server/protocol.c
@@ -217,6 +217,14 @@ AP_DECLARE(apr_status_t) ap_rgetline_core(char **s, apr_size_t n,
char *pos, *last_char = *s;
int do_alloc = (*s == NULL), saw_eos = 0;
+ /*
+ * Initialize last_char as otherwise a random value will be compared
+ * against APR_ASCII_LF at the end of the loop if bb only contains an
+ * EOS bucket.
+ */
+ if (last_char)
+ *last_char = '\0';
+
for (;;) {
apr_brigade_cleanup(bb);
rv = ap_get_brigade(r->input_filters, bb, AP_MODE_GETLINE,