]> granicus.if.org Git - php/commitdiff
add missing checks around expand_filepath()
authorNuno Lopes <nlopess@php.net>
Sat, 16 Sep 2006 18:15:25 +0000 (18:15 +0000)
committerNuno Lopes <nlopess@php.net>
Sat, 16 Sep 2006 18:15:25 +0000 (18:15 +0000)
ext/xmlreader/php_xmlreader.c
ext/xmlwriter/php_xmlwriter.c

index 05d1bb9a516fde2818956f3fa6631ece5aa313ed..d5eca3d1670e4289f21c3436ec0ae3e5c6be8c59 100644 (file)
@@ -260,9 +260,8 @@ char *_xmlreader_get_valid_file_path(char *source, char *resolved_path, int reso
        file_dest = source;
 
        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)) {
+                       return NULL;
                }
                file_dest = resolved_path;
        }
index 5628b2c7a15111eae889200a155bbac87529bebd..6baa512046c2e1739dc1948564bc8bfc78be3c88 100644 (file)
@@ -272,9 +272,8 @@ char *_xmlwriter_get_valid_file_path(char *source, char *resolved_path, int reso
        file_dest = source;
 
        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)) {
+                       return NULL;
                }
                file_dest = resolved_path;
        }