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 months ago
parent
commit
c0e2667b71
3 changed files with 3 additions and 3 deletions
  1. +1
    -1
      src/mod_cgi.c
  2. +1
    -1
      src/mod_fastcgi.c
  3. +1
    -1
      src/mod_scgi.c

+ 1
- 1
src/mod_cgi.c View File

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


+ 1
- 1
src/mod_fastcgi.c View File

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


+ 1
- 1
src/mod_scgi.c View File

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