Skip to content

Commit 9540d95

Browse files
committed
Fix stuffs
1 parent 307b242 commit 9540d95

File tree

4 files changed

+11
-107
lines changed

4 files changed

+11
-107
lines changed

ext/ldap/ldap.c

Lines changed: 8 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1523,10 +1523,6 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
15231523
} else {
15241524
nfilters = 0; /* this means string, not array */
15251525
ldap_filter = zend_string_copy(filter_str);
1526-
if (EG(exception)) {
1527-
ret = 0;
1528-
goto cleanup;
1529-
}
15301526
}
15311527

15321528
lds = safe_emalloc(nlinks, sizeof(ldap_linkdata), 0);
@@ -1597,23 +1593,21 @@ static void php_ldap_do_search(INTERNAL_FUNCTION_PARAMETERS, int scope)
15971593
efree(lds);
15981594
efree(rcs);
15991595
} else {
1600-
ldap_filter = zval_get_string(filter);
1601-
if (EG(exception)) {
1596+
ld = (ldap_linkdata *) zend_fetch_resource_ex(link, "ldap link", le_link);
1597+
if (ld == NULL) {
16021598
ret = 0;
16031599
goto cleanup;
16041600
}
16051601

1606-
ldap_base_dn = zval_get_string(base_dn);
1607-
if (EG(exception)) {
1608-
ret = 0;
1609-
goto cleanup;
1602+
if (!base_dn_str) {
1603+
zend_argument_type_error(2, "must be of type string when argument #1 ($link_identifier) is a resource");
16101604
}
1605+
ldap_base_dn = zend_string_copy(base_dn_str);
16111606

1612-
ld = (ldap_linkdata *) zend_fetch_resource_ex(link, "ldap link", le_link);
1613-
if (ld == NULL) {
1614-
ret = 0;
1615-
goto cleanup;
1607+
if (!filter_str) {
1608+
zend_argument_type_error(3, "must be of type string when argument #1 ($link_identifier) is a resource");
16161609
}
1610+
ldap_filter = zend_string_copy(filter_str);
16171611

16181612
if (argcount > 8) {
16191613
lserverctrls = _php_ldap_controls_from_array(ld->link, serverctrls);

ext/snmp/snmp.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1086,7 +1086,6 @@ static void php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st, int version)
10861086
zend_bool use_orignames = 0, suffix_keys = 0;
10871087
zend_long timeout = SNMP_DEFAULT_TIMEOUT;
10881088
zend_long retries = SNMP_DEFAULT_RETRIES;
1089-
int argc = ZEND_NUM_ARGS();
10901089
struct objid_query objid_query;
10911090
php_snmp_session *session;
10921091
int session_less_mode = (getThis() == NULL);

ext/snmp/tests/reflection.phpt

Lines changed: 0 additions & 89 deletions
This file was deleted.

ext/standard/streamsfuncs.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -998,19 +998,19 @@ PHP_FUNCTION(stream_context_set_option)
998998
if (options) {
999999
if (optionname) {
10001000
zend_argument_value_error(3, "must be null when argument #2 ($wrapper_or_options) is an array");
1001-
RETURN_THROWS();
1001+
RETURN_THROWS();
10021002
}
10031003

10041004
if (zvalue) {
10051005
zend_argument_value_error(4, "cannot be provided when argument #2 ($wrapper_or_options) is an array");
1006-
RETURN_THROWS();
1006+
RETURN_THROWS();
10071007
}
10081008

10091009
RETURN_BOOL(parse_context_options(context, options) == SUCCESS);
10101010
} else {
10111011
if (!optionname) {
10121012
zend_argument_value_error(3, "cannot be null when argument #2 ($wrapper_or_options) is a string");
1013-
RETURN_THROWS();
1013+
RETURN_THROWS();
10141014
}
10151015

10161016
RETURN_BOOL(php_stream_context_set_option(context, ZSTR_VAL(wrappername), optionname, zvalue) == SUCCESS);

0 commit comments

Comments
 (0)