ldapcli: allocate control value on the control object not on the control container
authorMatthieu Patou <mat@matws.net>
Sat, 26 Feb 2011 18:07:51 +0000 (21:07 +0300)
committerMatthieu Patou <mat@samba.org>
Sun, 20 Mar 2011 10:27:25 +0000 (11:27 +0100)
libcli/ldap/ldap_message.c

index 7756e73..0f54230 100644 (file)
@@ -1572,11 +1572,11 @@ _PUBLIC_ NTSTATUS ldap_decode(struct asn1_data *data,
                                return NT_STATUS_LDAP(LDAP_OPERATIONS_ERROR);
                        }
 
-                       if (!ldap_decode_control_wrapper(ctrl, data, ctrl[i], &value)) {
+                       if (!ldap_decode_control_wrapper(ctrl[i], data, ctrl[i], &value)) {
                                return NT_STATUS_LDAP(LDAP_PROTOCOL_ERROR);
                        }
                        
-                       if (!ldap_decode_control_value(ctrl, value,
+                       if (!ldap_decode_control_value(ctrl[i], value,
                                                       control_handlers,
                                                       ctrl[i])) {
                                if (ctrl[i]->critical) {