summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2013-08-18 19:37:56 +0000
committerAndrew Bartlett <abartlet@samba.org>2013-08-19 11:08:17 +1200
commit35330aa2c8b255d74e94bc9dd742e621953c21f9 (patch)
tree34b4ffe6bc43eb41dd90f12f153ff1eed01791c2
parentf82daa054ad95c6b1ae5cfce1efb6dc461389bc9 (diff)
downloadsamba-35330aa2c8b255d74e94bc9dd742e621953c21f9.tar.gz
samba-35330aa2c8b255d74e94bc9dd742e621953c21f9.tar.bz2
samba-35330aa2c8b255d74e94bc9dd742e621953c21f9.zip
samdb: Fix CID 1034910 Dereference before null check
strncmp("tdb://", secrets_ldb, 6) dereferences secrets_ldb. Check for NULL before that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
-rw-r--r--source4/dsdb/samdb/ldb_modules/secrets_tdb_sync.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/secrets_tdb_sync.c b/source4/dsdb/samdb/ldb_modules/secrets_tdb_sync.c
index e3d8485c61..284aa1b6e2 100644
--- a/source4/dsdb/samdb/ldb_modules/secrets_tdb_sync.c
+++ b/source4/dsdb/samdb/ldb_modules/secrets_tdb_sync.c
@@ -489,12 +489,12 @@ static int secrets_tdb_sync_init(struct ldb_module *module)
ldb_module_set_private(module, data);
secrets_ldb = (const char *)ldb_get_opaque(ldb, "ldb_url");
- if (strncmp("tdb://", secrets_ldb, 6) == 0) {
- secrets_ldb += 6;
- }
if (!secrets_ldb) {
return ldb_operr(ldb);
}
+ if (strncmp("tdb://", secrets_ldb, 6) == 0) {
+ secrets_ldb += 6;
+ }
private_dir = talloc_strdup(data, secrets_ldb);
p = strrchr(private_dir, '/');
if (p) {