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
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;
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;