]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
CID 1452121: dsdb/mod/partition: protect whole function with NULL check
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Tue, 30 Jul 2019 22:20:07 +0000 (10:20 +1200)
committerAndrew Bartlett <abartlet@samba.org>
Wed, 31 Jul 2019 04:08:48 +0000 (04:08 +0000)
Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Autobuild-User(master): Andrew Bartlett <abartlet@samba.org>
Autobuild-Date(master): Wed Jul 31 04:08:48 UTC 2019 on sn-devel-184

source4/dsdb/samdb/ldb_modules/partition.c

index e34ba35680b743974e4213e5e9704aaf2c1f3f0d..6a65726c18175959f4925be1f6f51a1ade6dd787 100644 (file)
@@ -1231,11 +1231,16 @@ int partition_del_trans(struct ldb_module *module)
                                                              struct partition_private_data);
        bool trace = module && ldb_module_flags(ldb) & LDB_FLG_ENABLE_TRACING;
 
+       if (data == NULL) {
+               DEBUG(0,("partion delete transaction with no private data\n"));
+               return ldb_operr(ldb);
+       }
+
        /*
         * Order of del_trans calls must be the reverse of that in
         * partition_start_trans. See comment in that function for detail.
         */
-       if (data && data->partitions) {
+       if (data->partitions) {
                for (i=0; data->partitions[i]; i++);;
                for (i--; i>=0; i--) {
                        struct dsdb_partition *p = data->partitions[i];