Skip to content

Commit

Permalink
- Fixed bug #51237 (milter SAPI crash on startup)
Browse files Browse the repository at this point in the history
  patch by: igmar at palsenberg dot com
  • Loading branch information
felipensp committed Mar 8, 2010
1 parent 9186e47 commit 68f805a
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
1 change: 1 addition & 0 deletions NEWS
Expand Up @@ -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).
Expand Down
12 changes: 11 additions & 1 deletion sapi/milter/php_milter.c
Expand Up @@ -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)
Expand Down Expand Up @@ -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);
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 68f805a

Please sign in to comment.