summaryrefslogtreecommitdiff
path: root/source4/dsdb/samdb/ldb_modules
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:19 +1200
commit8c4e6f0cba164c91661a654e2ccc13c265a06953 (patch)
treec9f0fb472b33b8dd67341940cbba26a236902246 /source4/dsdb/samdb/ldb_modules
parent35330aa2c8b255d74e94bc9dd742e621953c21f9 (diff)
downloadsamba-8c4e6f0cba164c91661a654e2ccc13c265a06953.tar.gz
samba-8c4e6f0cba164c91661a654e2ccc13c265a06953.tar.bz2
samba-8c4e6f0cba164c91661a654e2ccc13c265a06953.zip
samdb: Fix CID 1034910 Dereference before null check
strncmp("tdb://", sam_name, 6) dereferences sam_name. Check for NULL before that. Signed-off-by: Volker Lendecke <vl@samba.org> Reviewed-by: Andrew Bartlett <abartlet@samba.org>
Diffstat (limited to 'source4/dsdb/samdb/ldb_modules')
-rw-r--r--source4/dsdb/samdb/ldb_modules/schema_load.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/schema_load.c b/source4/dsdb/samdb/ldb_modules/schema_load.c
index faaf3f2071..93e8e978fd 100644
--- a/source4/dsdb/samdb/ldb_modules/schema_load.c
+++ b/source4/dsdb/samdb/ldb_modules/schema_load.c
@@ -68,13 +68,13 @@ static int schema_metadata_open(struct ldb_module *module)
}
sam_name = (const char *)ldb_get_opaque(ldb, "ldb_url");
- if (strncmp("tdb://", sam_name, 6) == 0) {
- sam_name += 6;
- }
if (!sam_name) {
talloc_free(tmp_ctx);
return ldb_operr(ldb);
}
+ if (strncmp("tdb://", sam_name, 6) == 0) {
+ sam_name += 6;
+ }
filename = talloc_asprintf(tmp_ctx, "%s.d/metadata.tdb", sam_name);
if (!filename) {
talloc_free(tmp_ctx);