]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-7.4'
authorChristoph M. Becker <cmbecker69@gmx.de>
Tue, 8 Oct 2019 07:50:43 +0000 (09:50 +0200)
committerChristoph M. Becker <cmbecker69@gmx.de>
Tue, 8 Oct 2019 07:50:43 +0000 (09:50 +0200)
* PHP-7.4:
  Fix #78641: addGlob can modify given remove_path value

1  2 
ext/zip/php_zip.c

index d30ad8747f654352f2341436e6c756218f25f3df,966efb58e6980aee1704ea429104562d0c01fdb3..e4fcc362ec5bb0250e78ee5ad21faeffbdeff369
@@@ -1601,8 -1681,7 +1602,8 @@@ static void php_zip_add_from_pattern(IN
        if (remove_path && remove_path_len > 1) {
                size_t real_len = strlen(remove_path);
                if ((real_len > 1) && ((remove_path[real_len - 1] == '/') || (remove_path[real_len - 1] == '\\'))) {
-                       remove_path[real_len - 1] = '\0';
+                       remove_path = estrndup(remove_path, real_len - 1);
 +                      remove_path_len -= 1;
                }
        }