ndr_sec_helper: create a completely zero sid, so that ndr_size_dom_sid28 can return 0
authorStefan Metzmacher <metze@samba.org>
Thu, 14 Feb 2008 14:03:37 +0000 (15:03 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 15 Feb 2008 07:52:23 +0000 (08:52 +0100)
metze
(This used to be commit ae6976eb4a8ddafc40ce91f68c9bca861502093b)

source4/librpc/ndr/ndr_sec_helper.c

index 30eaf9c6f47f45d07702b11018388f8ddd42959a..5a0178bd25bbee897b5b8731060b0821ce5b2b6e 100644 (file)
@@ -187,6 +187,9 @@ enum ndr_err_code ndr_pull_dom_sid28(struct ndr_pull *ndr, int ndr_flags, struct
        if (!NDR_ERR_CODE_IS_SUCCESS(status)) {
                /* handle a w2k bug which send random data in the buffer */
                ZERO_STRUCTP(sid);
+       } else if (sid->num_auths == 0 && sid->sub_auths) {
+               talloc_free(sid->sub_auths);
+               sid->sub_auths = NULL;
        }
 
        return NDR_ERR_SUCCESS;