Browse Source

Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix a very rare case of use of uninitialized value combined with a memleak
PHP-5.5.4
Michael Wallner 13 years ago
parent
commit
a34b141e08
  1. 7
      main/fopen_wrappers.c

7
main/fopen_wrappers.c

@ -775,7 +775,12 @@ PHPAPI char *expand_filepath_with_mode(const char *filepath, char *real_path, co
* we cannot cannot getcwd() and the requested,
* relatively referenced file is accessible */
copy_len = strlen(filepath) > MAXPATHLEN - 1 ? MAXPATHLEN - 1 : strlen(filepath);
real_path = estrndup(filepath, copy_len);
if (real_path) {
memcpy(real_path, filepath, copy_len);
real_path[copy_len] = '\0';
} else {
real_path = estrndup(filepath, copy_len);
}
close(fdtest);
return real_path;
} else {

Loading…
Cancel
Save