Browse Source

Fix mod_cgi environment keys mangling (fixes #1969)

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.x@2497 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.23
Stefan Bühler 13 years ago
parent
commit
a78acf99a1
  1. 1
      NEWS
  2. 12
      src/mod_cgi.c

1
NEWS

@ -37,6 +37,7 @@ NEWS
* Fix error message if no auth backend was set
* Fix SERVER_NAME port stripping (fixes #1968)
* Fix x-sendfile 2gb limiting (fixes #1970)
* Fix mod_cgi environment keys mangling (fixes #1969)
- 1.4.22 - 2009-03-07
* Fix wrong lua type for CACHE_MISS/CACHE_HIT in mod_cml (fixes #533)

12
src/mod_cgi.c

@ -973,9 +973,15 @@ static int cgi_create_env(server *srv, connection *con, plugin_data *p, buffer *
buffer_prepare_append(p->tmp_buf, ds->key->used + 2);
for (j = 0; j < ds->key->used - 1; j++) {
p->tmp_buf->ptr[p->tmp_buf->used++] =
light_isalnum((unsigned char)ds->key->ptr[j]) ?
toupper((unsigned char)ds->key->ptr[j]) : '_';
char cr = '_';
if (light_isalpha(ds->key->ptr[j])) {
/* upper-case */
cr = ds->key->ptr[j] & ~32;
} else if (light_isdigit(ds->key->ptr[j])) {
/* copy */
cr = ds->key->ptr[j];
}
p->tmp_buf->ptr[p->tmp_buf->used++] = cr;
}
p->tmp_buf->ptr[p->tmp_buf->used++] = '\0';

Loading…
Cancel
Save