Browse Source

Fix SERVER_NAME port stripping (fixes #1968)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2492 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.23
Stefan Bühler 13 years ago
parent
commit
ecfdc60945
  1. 1
      NEWS
  2. 6
      src/mod_cgi.c
  3. 4
      src/mod_fastcgi.c
  4. 7
      src/mod_scgi.c

1
NEWS

@ -35,6 +35,7 @@ NEWS
* Add IPv6 support to mod_proxy (fixes #1537)
* mod_ssi printenv: print cgi env, add environment vars to cgi env (fixes #1713)
* Fix error message if no auth backend was set
* Fix SERVER_NAME port stripping (fixes #1968)
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

6
src/mod_cgi.c

@ -699,11 +699,11 @@ static int cgi_env_add(char_array *env, const char *key, size_t key_len, const c
if (!key || !val) return -1;
dst = malloc(key_len + val_len + 3);
dst = malloc(key_len + val_len + 2);
memcpy(dst, key, key_len);
dst[key_len] = '=';
/* add the \0 from the value */
memcpy(dst + key_len + 1, val, val_len + 1);
memcpy(dst + key_len + 1, val, val_len);
dst[key_len + 1 + val_len] = '\0';
if (env->size == 0) {
env->size = 16;

4
src/mod_fastcgi.c

@ -702,8 +702,8 @@ static int env_add(char_array *env, const char *key, size_t key_len, const char
dst = malloc(key_len + val_len + 3);
memcpy(dst, key, key_len);
dst[key_len] = '=';
/* add the \0 from the value */
memcpy(dst + key_len + 1, val, val_len + 1);
memcpy(dst + key_len + 1, val, val_len);
dst[key_len + 1 + val_len] = '\0';
for (i = 0; i < env->used; i++) {
if (0 == strncmp(dst, env->ptr[i], key_len + 1)) {

7
src/mod_scgi.c

@ -1283,10 +1283,11 @@ static int scgi_env_add(buffer *env, const char *key, size_t key_len, const char
buffer_prepare_append(env, len);
/* include the NUL */
memcpy(env->ptr + env->used, key, key_len + 1);
memcpy(env->ptr + env->used, key, key_len);
env->ptr[env->used + key_len] = '\0';
env->used += key_len + 1;
memcpy(env->ptr + env->used, val, val_len + 1);
memcpy(env->ptr + env->used, val, val_len);
env->ptr[env->used + val_len] = '\0';
env->used += val_len + 1;
return 0;

Loading…
Cancel
Save