]> granicus.if.org Git - php/commitdiff
MFB: One last expand_filepath() check
authorIlia Alshanetsky <iliaa@php.net>
Sat, 16 Sep 2006 19:08:59 +0000 (19:08 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Sat, 16 Sep 2006 19:08:59 +0000 (19:08 +0000)
ext/dom/document.c

index a5218462e61208423d2df814ce531b9af0017caf..cffdb6a334016c2cee8feb1e68115be9acd3363f 100644 (file)
@@ -1395,8 +1395,9 @@ char *_dom_get_valid_file_path(char *source, char *resolved_path, int resolved_p
 
        if ((uri->scheme == NULL || isFileUri)) {
                /* XXX possible buffer overflow if VCWD_REALPATH does not know size of resolved_path */
-               if (! VCWD_REALPATH(source, resolved_path)) {
-                       expand_filepath(source, resolved_path TSRMLS_CC);
+               if (!VCWD_REALPATH(source, resolved_path) && !expand_filepath(source, resolved_path TSRMLS_CC)) {
+                       xmlFreeURI(uri);
+                       return NULL;
                }
                file_dest = resolved_path;
        }