summaryrefslogtreecommitdiffstats
path: root/server/util_script.c
diff options
context:
space:
mode:
authorStefan Fritsch <sf@apache.org>2012-02-14 22:18:22 +0100
committerStefan Fritsch <sf@apache.org>2012-02-14 22:18:22 +0100
commite9ac8ddb83db385920aeb1178d701e02ee869296 (patch)
tree815fd0b02583ae7f51cd3f33af136645d8f2b1f0 /server/util_script.c
parentTo early, not enough drugs, sorry for the noise. (diff)
downloadapache2-e9ac8ddb83db385920aeb1178d701e02ee869296.tar.xz
apache2-e9ac8ddb83db385920aeb1178d701e02ee869296.zip
Make sure the getsfunc_*() functions used by ap_scan_script_header_err*()
NUL-terminate the resulting string, even in case of an error. mod_cgi and mod_cgid try to log incomplete output from CGI scripts. git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1244211 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r--server/util_script.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/server/util_script.c b/server/util_script.c
index 3f7d847a7d..18c4aea4ca 100644
--- a/server/util_script.c
+++ b/server/util_script.c
@@ -682,6 +682,7 @@ static int getsfunc_BRIGADE(char *buf, int len, void *arg)
rv = apr_bucket_read(e, &bucket_data, &bucket_data_len,
APR_BLOCK_READ);
if (rv != APR_SUCCESS || (bucket_data_len == 0)) {
+ *dst = '\0';
return APR_STATUS_IS_TIMEUP(rv) ? -1 : 0;
}
src = bucket_data;
@@ -738,8 +739,10 @@ static int getsfunc_STRING(char *w, int len, void *pvastrs)
const char *p;
int t;
- if (!strs->curpos || !*strs->curpos)
+ if (!strs->curpos || !*strs->curpos) {
+ w[0] = '\0';
return 0;
+ }
p = ap_strchr_c(strs->curpos, '\n');
if (p)
++p;