Skip to content

Commit

Permalink
Fixed ldap_exop_whoami and added a test for it
Browse files Browse the repository at this point in the history
  • Loading branch information
Côme Chilliet committed Jul 3, 2017
1 parent ae76c8b commit fdafd68
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions ext/ldap/ldap.c
Original file line number Diff line number Diff line change
Expand Up @@ -2672,13 +2672,13 @@ PHP_FUNCTION(ldap_parse_exop_passwd)
Extract information from <draft-zeilenga-ldap-authzid> whoami extended operation result (a Work in Progress) */
PHP_FUNCTION(ldap_parse_exop_whoami)
{
zval *link, *result, **authzid;
zval *link, *result, *authzid;
ldap_linkdata *ld;
LDAPMessage *ldap_result;
struct berval *lauthzid;
int rc, myargcount = ZEND_NUM_ARGS();

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrZ", &link, &result, &authzid) != SUCCESS) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "rrz/", &link, &result, &authzid) != SUCCESS) {
WRONG_PARAM_COUNT;
}

Expand All @@ -2696,11 +2696,11 @@ PHP_FUNCTION(ldap_parse_exop_whoami)
RETURN_FALSE;
}

zval_dtor(*authzid);
zval_dtor(authzid);
if (lauthzid == NULL) {
ZVAL_EMPTY_STRING(*authzid);
ZVAL_EMPTY_STRING(authzid);
} else {
ZVAL_STRINGL(*authzid, lauthzid->bv_val, lauthzid->bv_len);
ZVAL_STRINGL(authzid, lauthzid->bv_val, lauthzid->bv_len);
ldap_memfree(lauthzid->bv_val);
ldap_memfree(lauthzid);
}
Expand Down Expand Up @@ -3496,7 +3496,7 @@ PHP_FUNCTION(ldap_exop_whoami)
LDAPMessage *ldap_res;
int rc, msgid, myargcount = ZEND_NUM_ARGS();

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z", &link, &authzid) == FAILURE) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|z/", &link, &authzid) == FAILURE) {
WRONG_PARAM_COUNT;
}

Expand Down

0 comments on commit fdafd68

Please sign in to comment.