diff options
Diffstat (limited to 'ext/xmlwriter')
-rw-r--r-- | ext/xmlwriter/php_xmlwriter.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/xmlwriter/php_xmlwriter.c b/ext/xmlwriter/php_xmlwriter.c index 5628b2c7a1..6baa512046 100644 --- a/ext/xmlwriter/php_xmlwriter.c +++ b/ext/xmlwriter/php_xmlwriter.c @@ -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; } |