s4/source4/common: clang: Fix 'Dereference of undefined pointer value'
authorNoel Power <noel.power@suse.com>
Fri, 5 Jul 2019 11:34:25 +0000 (11:34 +0000)
committerGary Lockyer <gary@samba.org>
Wed, 24 Jul 2019 05:49:14 +0000 (05:49 +0000)
commit54af94ff21a7f395133bcc13458cc2e1f52183be
tree030fa15b9cd377d97d328aabc398cdb30c09d761
parentc7c40e205d432342457b20312f3ebf94e15b9ff6
s4/source4/common: clang: Fix 'Dereference of undefined pointer value'

Fixes:

source4/dsdb/common/util.c:3131:6: warning: Dereference of undefined pointer value <--[clang]
        if (res->count < 1) {
            ^

/source4/dsdb/common/util.c:3207:6: warning: Dereference of undefined pointer value <--[clang]
        if (res->count < 1) {
            ^~~~~~~~~~
source4/dsdb/common/util.c:4004:39: warning: Dereference of undefined pointer value <--[clang]
        (*wkguid_dn) = talloc_steal(mem_ctx, res->msgs[0]->dn);
                                             ^
source4/dsdb/common/util.c:4191:35: warning: Dereference of undefined pointer value <--[clang]
        ouv_value = ldb_msg_find_ldb_val(r->msgs[0], "replUpToDateVector");

source4/dsdb/common/util.c:5757:13: warning: 1st function call argument is an uninitialized value <--[clang]
        same_nc = (ldb_dn_compare(source_nc, target_nc) == 0);
                   ^
This fix also fixes the associated 'Access to field 'xyx' results in a
dereference of a null pointer' warnings that also will happen when this
is fixed

Signed-off-by: Noel Power <noel.power@suse.com>
Reviewed-by: Gary Lockyer <gary@catalyst.net.nz>
Autobuild-User(master): Gary Lockyer <gary@samba.org>
Autobuild-Date(master): Wed Jul 24 05:49:14 UTC 2019 on sn-devel-184
source4/dsdb/common/util.c