cvs: php4 /ext/standard file.c

From: Date: Fri, 21 Mar 2003 22:22:16 +0000
Subject: cvs: php4 /ext/standard file.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-19714@lists.php.net to get a copy of this message
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) {

« previous php.cvs (#19714) next »