summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2002-09-13 13:34:06 +0000
committerIlia Alshanetsky <iliaa@php.net>2002-09-13 13:34:06 +0000
commit687312be415474fc6943e0ade26825e7544dcd84 (patch)
tree8134279dd3d30de6505d3e0957db2dd580f4e84e
parent61043c0cdfdc12a33c3185cc33a89dba73ba313e (diff)
downloadphp-git-687312be415474fc6943e0ade26825e7544dcd84.tar.gz
Do not create the destination file, if opening of the source file failed
during copy().
-rw-r--r--ext/standard/file.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/ext/standard/file.c b/ext/standard/file.c
index 2332f1423d..33eb58da95 100644
--- a/ext/standard/file.c
+++ b/ext/standard/file.c
@@ -1883,6 +1883,9 @@ PHPAPI int php_copy_file(char *src, char *dest TSRMLS_DC)
srcstream = php_stream_open_wrapper(src, "rb",
ENFORCE_SAFE_MODE | REPORT_ERRORS,
NULL);
+
+ if (!srcstream)
+ return ret;
deststream = php_stream_open_wrapper(dest, "wb",
ENFORCE_SAFE_MODE | REPORT_ERRORS,