sterling Fri Mar 21 17:22:16 2003 EDT Modified files: /php4/ext/standard file.c Log: fix segfault in file_set_contents() when the file could not successfully be opened. Index: php4/ext/standard/file.c diff -u php4/ext/standard/file.c:1.327 php4/ext/standard/file.c:1.328 --- php4/ext/standard/file.c:1.327 Tue Mar 18 09:35:15 2003 +++ php4/ext/standard/file.c Fri Mar 21 17:22:15 2003 @@ -21,7 +21,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: file.c,v 1.327 2003/03/18 14:35:15 wez Exp $ */ +/* $Id: file.c,v 1.328 2003/03/21 22:22:15 sterling Exp $ */ /* Synced with php 3.0 revision 1.218 1999-06-16 [ssb] */ @@ -476,6 +476,10 @@ stream = php_stream_open_wrapper(filename, "wb", (use_include_path ? USE_PATH : 0) | ENFORCE_SAFE_MODE | REPORT_ERRORS, NULL); + if (stream == NULL) { + RETURN_FALSE; + } + if (data_len) { numbytes = php_stream_write(stream, data, data_len); if (numbytes < 0) {
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php