wez Tue Oct 15 12:45:27 2002 EDT
Modified files:
/php4/ext/standard file.c
/php4/main streams.c
Log:
Nope, that last one wasn't a leak in main/streams.c, it was
file_get_contents misinterpreting the result...
Index: php4/ext/standard/file.c
diff -u php4/ext/standard/file.c:1.269 php4/ext/standard/file.c:1.270
--- php4/ext/standard/file.c:1.269 Sun Oct 13 22:28:35 2002
+++ php4/ext/standard/file.c Tue Oct 15 12:45:26 2002
@@ -21,7 +21,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: file.c,v 1.269 2002/10/14 02:28:35 wez Exp $ */
+/* $Id: file.c,v 1.270 2002/10/15 16:45:26 wez Exp $ */
/* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */
@@ -435,7 +435,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 */
Index: php4/main/streams.c
diff -u php4/main/streams.c:1.107 php4/main/streams.c:1.108
--- php4/main/streams.c:1.107 Tue Oct 15 12:38:11 2002
+++ php4/main/streams.c Tue Oct 15 12:45:26 2002
@@ -20,7 +20,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: streams.c,v 1.107 2002/10/15 16:38:11 wez Exp $ */
+/* $Id: streams.c,v 1.108 2002/10/15 16:45:26 wez Exp $ */
#define _GNU_SOURCE
#include "php.h"
@@ -1028,7 +1028,7 @@
#endif
srcfile = mmap(NULL, maxlen, PROT_READ, MAP_SHARED, srcfd, 0);
- if (srcfile != (void*)MAP_FAILED && ret > 0) {
+ if (srcfile != (void*)MAP_FAILED) {
*buf = pemalloc_rel_orig(maxlen + 1, persistent);
--
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php