]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6'
authorChristoph M. Becker <cmb@php.net>
Fri, 14 Aug 2015 15:18:35 +0000 (17:18 +0200)
committerChristoph M. Becker <cmb@php.net>
Fri, 14 Aug 2015 15:18:35 +0000 (17:18 +0200)
* PHP-5.6:
  Fix #70264: CLI server directory traversal

1  2 
sapi/cli/php_cli_server.c

index 9c00fa0bdfe5752c531a8ecce4f29099e54bf981,e4ea00ac3324074cb273a5d2f8a33f2f0bc429c8..709154da70431519e3fd84b69622a20b98902eed
@@@ -1467,8 -1577,20 +1467,20 @@@ static void normalize_vpath(char **retv
                return;
        }
  
 -      decoded_vpath_end = decoded_vpath + php_url_decode(decoded_vpath, vpath_len);
 +      decoded_vpath_end = decoded_vpath + php_url_decode(decoded_vpath, (int)vpath_len);
  
+ #ifdef PHP_WIN32
+       {
+               char *p = decoded_vpath;
+               
+               do {
+                       if (*p == '\\') {
+                               *p = '/';
+                       }
+               } while (*p++);
+       }
+ #endif
        p = decoded_vpath;
  
        if (p < decoded_vpath_end && *p == '/') {