summaryrefslogtreecommitdiff
path: root/ext/vpopmail/php_vpopmail.c
diff options
context:
space:
mode:
authorBoian Bonev <bbonev@php.net>2001-02-08 23:31:01 +0000
committerBoian Bonev <bbonev@php.net>2001-02-08 23:31:01 +0000
commite7a148a75841de22f53ed9207795933dc6ddf0b8 (patch)
tree3d0c11b960f19fa863f5fc7c0513571cc39b67cc /ext/vpopmail/php_vpopmail.c
parent6b0d9e19e183c688f857a5405ed7d06c197c2c02 (diff)
downloadphp-git-e7a148a75841de22f53ed9207795933dc6ddf0b8.tar.gz
fixed SIGSEGV in vpopmail_auth_user when optional arg apop is not set
Diffstat (limited to 'ext/vpopmail/php_vpopmail.c')
-rw-r--r--ext/vpopmail/php_vpopmail.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/ext/vpopmail/php_vpopmail.c b/ext/vpopmail/php_vpopmail.c
index 291617126b..05000f0d7b 100644
--- a/ext/vpopmail/php_vpopmail.c
+++ b/ext/vpopmail/php_vpopmail.c
@@ -694,12 +694,13 @@ PHP_FUNCTION(vpopmail_auth_user)
zval **password;
zval **apop;
struct passwd *retval;
+ int argc=ZEND_NUM_ARGS();
- if (ZEND_NUM_ARGS() < 3 || ZEND_NUM_ARGS() > 4
+ if (argc < 3 || argc > 4
|| zend_get_parameters_ex(ZEND_NUM_ARGS(), &user, &domain, &password, &apop) == FAILURE)
WRONG_PARAM_COUNT;
- if (ZEND_NUM_ARGS() > 3)
+ if (argc > 3)
convert_to_string_ex(apop);
convert_to_string_ex(user);
@@ -713,7 +714,7 @@ PHP_FUNCTION(vpopmail_auth_user)
retval = vauth_user(Z_STRVAL_PP(user),
Z_STRVAL_PP(domain),
Z_STRVAL_PP(password),
- Z_STRVAL_PP(apop));
+ (argc>3)?Z_STRVAL_PP(apop):"");
/*
* we do not set vpopmail_errno here - it is considered auth_user cannot fail; insted it does not auth