File apache2-mod_proxy_uwsgi-fix-crash.patch of Package apache2.16435
--- a/modules/proxy/mod_proxy_uwsgi.c 2020/07/15 07:48:38 1879877
+++ b/modules/proxy/mod_proxy_uwsgi.c 2020/07/15 08:24:13 1879878
@@ -175,7 +175,7 @@ static int uwsgi_send_headers(request_re
env = (apr_table_entry_t *) env_table->elts;
for (j = 0; j < env_table->nelts; ++j) {
- headerlen += 2 + strlen(env[j].key) + 2 + strlen(env[j].val);
+ headerlen += 2 + strlen(env[j].key) + 2 + (env[j].val ? strlen(env[j].val) : 0);
}
ptr = buf = apr_palloc(r->pool, headerlen);
@@ -189,10 +189,12 @@ static int uwsgi_send_headers(request_re
memcpy(ptr, env[j].key, keylen);
ptr += keylen;
- vallen = strlen(env[j].val);
+ vallen = env[j].val ? strlen(env[j].val) : 0;
*ptr++ = (apr_byte_t) (vallen & 0xff);
*ptr++ = (apr_byte_t) ((vallen >> 8) & 0xff);
- memcpy(ptr, env[j].val, vallen);
+ if (env[j].val) {
+ memcpy(ptr, env[j].val, vallen);
+ }
ptr += vallen;
}