s4-backupkey: Initialize ndr->switchlist for print
authorArvid Requate <requate@univention.de>
Mon, 7 Jul 2014 16:36:49 +0000 (18:36 +0200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 25 Feb 2015 00:08:11 +0000 (01:08 +0100)
ndr_print_bkrp_data_in_blob requires the level to be set in the
proper ndr->switch_list context.

Signed-off-by: Arvid Requate <requate@univention.de>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Garming Sam <garming@catalyst.net.nz>
librpc/ndr/ndr_backupkey.c

index ddbaeea0007fa66eed73585333b990604f5362ce..827bc69423061bcc3911fb676e46e7c4500cb5d1 100644 (file)
@@ -71,6 +71,11 @@ _PUBLIC_ void ndr_print_bkrp_BackupKey(struct ndr_print *ndr, const char *name,
                ndr->depth--;
 
                level = backupkeyguid_to_uint(r->in.guidActionAgent);
+               ndr_err = ndr_print_set_switch_value(ndr, &inblob, level);
+               if (unlikely(!NDR_ERR_CODE_IS_SUCCESS(ndr_err))) {      \
+                       DEBUG(0,("ERROR: ndr_print_bkrp_BackupKey ndr_print_set_switch_value failed: %d\n", ndr_err));
+                       return;
+               }
                blob.data = r->in.data_in;
                blob.length = r->in.data_in_len;
                ndr_err = ndr_pull_union_blob(&blob, ndr, &inblob, level,