summaryrefslogtreecommitdiff
path: root/sapi/cgi/cgi_main.c
diff options
context:
space:
mode:
authorstodorovic <sasa.todorovic@gmx.com>2018-10-02 08:36:29 +0200
committerChristoph M. Becker <cmbecker69@gmx.de>2018-10-08 12:29:31 +0200
commit47b89bc5314534e4aab4a8d6cda0da9d079366f6 (patch)
tree24a5ff84641860a1b767e34c0889d49a441ae1de /sapi/cgi/cgi_main.c
parentc097acd52e89a3b1d0cb6a181bb4650be9625b6c (diff)
downloadphp-git-47b89bc5314534e4aab4a8d6cda0da9d079366f6.tar.gz
Fix #76954: apache_response_headers removes last character from header name
Diffstat (limited to 'sapi/cgi/cgi_main.c')
-rw-r--r--sapi/cgi/cgi_main.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sapi/cgi/cgi_main.c b/sapi/cgi/cgi_main.c
index fda24290fc..56f0c5b9e8 100644
--- a/sapi/cgi/cgi_main.c
+++ b/sapi/cgi/cgi_main.c
@@ -1735,9 +1735,9 @@ static void add_response_header(sapi_header_struct *h, zval *return_value) /* {{
len = p - h->header;
}
if (len > 0) {
- do {
+ while (len != 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t')) {
len--;
- } while (len != 0 && (h->header[len-1] == ' ' || h->header[len-1] == '\t'));
+ }
if (len) {
s = do_alloca(len + 1, use_heap);
memcpy(s, h->header, len);