summaryrefslogtreecommitdiff
path: root/sapi/milter
diff options
context:
space:
mode:
authorFelipe Pena <felipe@php.net>2010-03-08 23:29:46 +0000
committerFelipe Pena <felipe@php.net>2010-03-08 23:29:46 +0000
commit68f805a6d027a605050542d83d5bda7071e7c3a6 (patch)
tree40ba84dcd0c0b830a035bd17722933152ba2be56 /sapi/milter
parent9186e478fa8f9b620c50f208676448163cea1b5f (diff)
downloadphp-git-68f805a6d027a605050542d83d5bda7071e7c3a6.tar.gz
- Fixed bug #51237 (milter SAPI crash on startup)
patch by: igmar at palsenberg dot com
Diffstat (limited to 'sapi/milter')
-rw-r--r--sapi/milter/php_milter.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/sapi/milter/php_milter.c b/sapi/milter/php_milter.c
index 6c07c018e2..11724c425c 100644
--- a/sapi/milter/php_milter.c
+++ b/sapi/milter/php_milter.c
@@ -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;