]> granicus.if.org Git - php/commitdiff
- Fixed bug #51237 (milter SAPI crash on startup)
authorFelipe Pena <felipe@php.net>
Mon, 8 Mar 2010 23:29:46 +0000 (23:29 +0000)
committerFelipe Pena <felipe@php.net>
Mon, 8 Mar 2010 23:29:46 +0000 (23:29 +0000)
  patch by: igmar at palsenberg dot com

NEWS
sapi/milter/php_milter.c

diff --git a/NEWS b/NEWS
index 78abcbc5e50c9d0643ba8ed07ee089a9af33bbd9..cb81b008695cbedb00360eb9c8987285d3825e03 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ PHP                                                                        NEWS
 - Added stream filter support to mcrypt extension (ported from 
   mcrypt_filter). (Stas)
 
+- Fixed bug #51237 (milter SAPI crash on startup). (igmar at palsenberg dot com)
 - Fixed bug #51213 (pdo_mssql is trimming value of the money column). (Ilia, 
   alexr at oplot dot com)
 - Fixed bug #51190 (ftp_put() returns false when transfer was successful).  
index 6c07c018e2cba0941972acaff7bc32c81a96ce5b..11724c425ca061ae32ac033cbb419e2c9d64ecf0 100644 (file)
@@ -92,7 +92,7 @@ extern char *ap_php_optarg;
 extern int ap_php_optind;
 
 static int flag_debug=0;
-static char *filename;
+static char *filename = NULL;
 
 /* per thread */
 ZEND_BEGIN_MODULE_GLOBALS(milter)
@@ -127,6 +127,11 @@ static int mlfi_init()
        /* disable headers */
        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);
@@ -189,6 +194,11 @@ static sfsistat    mlfi_connect(SMFICTX *ctx, char *hostname, _SOCK_ADDR *hostaddr)
        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;