]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
libnet4: check return value of DC lookup
authorBjörn Baumbach <bb@sernet.de>
Fri, 7 Feb 2025 11:03:18 +0000 (12:03 +0100)
committerDouglas Bagnall <dbagnall@samba.org>
Sat, 8 Feb 2025 03:30:27 +0000 (03:30 +0000)
Avoids possible segmentation fault when the lookup fails.

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

Pair-programmed-with: Volker Lendecke <vl@samba.org>
Signed-off-by: Volker Lendecke <vl@samba.org>
Signed-off-by: Björn Baumbach <bb@sernet.de>
Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Autobuild-User(master): Douglas Bagnall <dbagnall@samba.org>
Autobuild-Date(master): Sat Feb  8 03:30:27 UTC 2025 on atb-devel-224

source4/libnet/libnet_lookup.c

index f8477c7258cda4ac78ac42efd0e83736a00ee5c1..26cf26fe3e1e6200ce700f05bca08436c0f5327d 100644 (file)
@@ -223,6 +223,9 @@ NTSTATUS libnet_LookupDCs_recv(struct tevent_req *req, TALLOC_CTX *mem_ctx,
        NTSTATUS status;
        struct finddcs finddcs_io;
        status = finddcs_cldap_recv(req, mem_ctx, &finddcs_io);
+       if (!NT_STATUS_IS_OK(status)) {
+               return status;
+       }
        talloc_free(req);
        io->out.num_dcs = 1;
        io->out.dcs = talloc(mem_ctx, struct nbt_dc_name);