dsdb: Fix CID 1034966 Uninitialized scalar variable
authorVolker Lendecke <vl@samba.org>
Wed, 28 Mar 2018 20:43:53 +0000 (15:43 -0500)
committerJeremy Allison <jra@samba.org>
Tue, 3 Apr 2018 22:44:23 +0000 (00:44 +0200)
"continue" in a do-while loop jumps to the "while"-check, so "id_exists" needs
to be initialized by that point.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=13367

Signed-off-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source4/dsdb/samdb/ldb_modules/samldb.c

index 108235a91b4460ab3a61f684ef50554ab4c6b787..a46fd3735c8f6fc0d0d6fbd75b6075ada4c7f353 100644 (file)
@@ -875,6 +875,7 @@ static int samldb_add_handle_msDS_IntId(struct samldb_ctx *ac)
                 * order to be sure.
                 */
                if (dsdb_attribute_by_attributeID_id(schema, msds_intid)) {
+                       id_exists = true;
                        msds_intid = generate_random() % 0X3FFFFFFF;
                        msds_intid += 0x80000000;
                        continue;