mirror of
https://github.com/php/php-src.git
synced 2026-04-29 03:03:26 +02:00
Fix potentially uninitialized use in ldap
If ctrl->ldctl_value.bv_len is zero context is uninitialized. Only free it if the call took place and succeeded.
This commit is contained in:
+1
-1
@@ -265,10 +265,10 @@ static void _php_ldap_control_to_array(LDAP *ld, LDAPControl* ctrl, zval* array,
|
||||
add_assoc_stringl(&value, "context", context->bv_val, context->bv_len);
|
||||
}
|
||||
add_assoc_zval(array, "value", &value);
|
||||
ber_bvfree(context);
|
||||
} else {
|
||||
add_assoc_null(array, "value");
|
||||
}
|
||||
ber_bvfree(context);
|
||||
} else {
|
||||
if (ctrl->ldctl_value.bv_len) {
|
||||
add_assoc_stringl(array, "value", ctrl->ldctl_value.bv_val, ctrl->ldctl_value.bv_len);
|
||||
|
||||
Reference in New Issue
Block a user