cvs: php4 /ext/standard file.c
| From: | Sascha Schumann | Date: | Wed, 14 May 2003 08:27:48 +0000 |
| Subject: | cvs: php4 /ext/standard file.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-20894@lists.php.net to get a copy of this message | ||
sas Wed May 14 04:27:48 2003 EDT
Modified files:
/php4/ext/standard file.c
Log:
MFB segfault fix
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.338 php4/ext/standard/file.c:1.339
--- php4/ext/standard/file.c:1.338 Wed May 14 02:10:04 2003
+++ php4/ext/standard/file.c Wed May 14 04:27:48 2003
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.338 2003/05/14 06:10:04 pollita Exp $ */
+/* $Id: file.c,v 1.339 2003/05/14 08:27:48 sas Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -451,7 +451,7 @@
}
/* uses mmap if possible */
- if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) >= 0) {
+ if ((len = php_stream_copy_to_mem(stream, &contents, PHP_STREAM_COPY_ALL, 0)) > 0) {
if (PG(magic_quotes_runtime)) {
contents = php_addslashes(contents, len, &newlen, 1 TSRMLS_CC); /* 1 = free source string */
@@ -459,6 +459,8 @@
}
RETVAL_STRINGL(contents, len, 0);
+ } else if (len == 0) {
+ RETVAL_EMPTY_STRING();
} else {
RETVAL_FALSE;
}