cvs: php4 /ext/vpopmail php_vpopmail.c

From: Date: Thu, 08 Feb 2001 23:31:00 +0000
Subject: cvs: php4 /ext/vpopmail php_vpopmail.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-3959@lists.php.net to get a copy of this message
bbonev Thu Feb 8 15:31:00 2001 EDT Modified files: /php4/ext/vpopmail php_vpopmail.c Log: fixed SIGSEGV in vpopmail_auth_user when optional arg apop is not set Index: php4/ext/vpopmail/php_vpopmail.c diff -u php4/ext/vpopmail/php_vpopmail.c:1.7 php4/ext/vpopmail/php_vpopmail.c:1.8 --- php4/ext/vpopmail/php_vpopmail.c:1.7 Wed Feb 7 09:47:59 2001 +++ php4/ext/vpopmail/php_vpopmail.c Thu Feb 8 15:31:00 2001 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: php_vpopmail.c,v 1.7 2001/02/07 17:47:59 bbonev Exp $ */ +/* $Id: php_vpopmail.c,v 1.8 2001/02/08 23:31:00 bbonev Exp $ */ /* TODO: move to config.m4 when support for old versions is ready or just * don't support rather old vpopmail. current version must bail out if @@ -694,12 +694,13 @@ 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 @@ 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

« previous php.cvs (#3959) next »