Browse Source

[multiple] handle NULL val as empty in *_env_add (fixes #3030)

(bug on master branch; never released)

(thx flynn)

x-ref:
  "Fastcgi fails if server.tag is empty"
  https://redmine.lighttpd.net/issues/3030
master
Glenn Strauss 2 years ago
parent
commit
c0e2667b71
  1. 2
      src/mod_cgi.c
  2. 2
      src/mod_fastcgi.c
  3. 2
      src/mod_scgi.c

2
src/mod_cgi.c

@ -500,7 +500,7 @@ static int cgi_env_add(void *venv, const char *key, size_t key_len, const char *
env_accum *env = venv;
char *dst;
if (!key || !val) return -1;
if (!key || (!val && val_len)) return -1;
if (env->size - env->used < key_len + val_len + 2) {
if (0 == env->size) env->size = 4096;

2
src/mod_fastcgi.c

@ -149,7 +149,7 @@ static int fcgi_env_add(void *venv, const char *key, size_t key_len, const char
size_t len_enc_len = 0;
char *dst;
if (!key || !val) return -1;
if (!key || (!val && val_len)) return -1;
len = key_len + val_len;

2
src/mod_scgi.c

@ -149,7 +149,7 @@ static int scgi_env_add_scgi(void *venv, const char *key, size_t key_len, const
char *dst;
size_t len;
if (!key || !val) return -1;
if (!key || (!val && val_len)) return -1;
len = key_len + val_len + 2;

Loading…
Cancel
Save