fix cygwin-only path traversal

git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.4.11-ssl-fixes@1275 152afb58-edef-0310-8abb-c4023f1b3aa9
svn/tags/lighttpd-1.4.12
Jan Kneschke 16 years ago
parent 48ca389d89
commit 71e66c88ec
  1. 12
      src/buffer.c

@ -914,6 +914,18 @@ int buffer_path_simplify(buffer *dest, buffer *src)
start = dest->ptr;
out = dest->ptr;
slash = dest->ptr;
#if defined(__WIN32) || defined(__CYGWIN__)
/* cygwin is treating \ and / the same, so we have to that too
*/
for (walk = src->ptr; *walk; walk++) {
if (*walk == '\\') *walk = '/';
}
walk = src->ptr;
#endif
while (*walk == ' ') {
walk++;
}

Loading…
Cancel
Save