php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Return to Bug #51237
Patch Fix_startup_crash revision 2010-03-08 15:52 UTC by igmar at palsenberg dot com

Patch Fix_startup_crash for Reproducible crash Bug #51237

Patch version 2010-03-08 15:52 UTC

Return to Bug #51237 | Download this patch
Patch Revisions:

Developer: igmar@palsenberg.com

--- php-5.3.2/sapi/milter/php_milter.c.orig	2010-03-08 16:39:36.000000000 +0100
+++ php-5.3.2/sapi/milter/php_milter.c	2010-03-08 16:40:52.000000000 +0100
@@ -92,7 +92,7 @@
 extern int ap_php_optind;
 
 static int flag_debug=0;
-static char *filename;
+static char *filename = NULL;
 
 /* per thread */
 ZEND_BEGIN_MODULE_GLOBALS(milter)
@@ -128,6 +128,11 @@
 	SG(headers_sent) = 1;
 	SG(request_info).no_headers = 1;
 
+	if (filename == NULL) {
+		php_printf("No input file specified");
+		return SMFIS_TEMPFAIL;
+	}
+
 	if (!(file_handle.handle.fp = VCWD_FOPEN(filename, "rb"))) {
 		php_printf("Could not open input file: %s\n", filename);
 		return SMFIS_TEMPFAIL;
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 02:01:29 2024 UTC