From: Ilia Alshanetsky Date: Sat, 16 Sep 2006 19:07:35 +0000 (+0000) Subject: One last expand_filepath() check X-Git-Tag: php-5.2.0RC5~145 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9f217cd983a843b43261f7d181e92d3cc0430a4a;p=php One last expand_filepath() check --- diff --git a/ext/dom/document.c b/ext/dom/document.c index 88b591409c..8bbd469657 100644 --- a/ext/dom/document.c +++ b/ext/dom/document.c @@ -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; }