1
0
mirror of https://github.com/samba-team/samba.git synced 2025-02-23 09:57:40 +03:00

tdb_wrap: don't let tdb_wrap_open() segfault with name==NULL

Bug: https://bugzilla.samba.org/show_bug.cgi?id=11032

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Michael Adam <obnox@samba.org>

Autobuild-User(master): Michael Adam <obnox@samba.org>
Autobuild-Date(master): Mon Jan 19 16:17:28 CET 2015 on sn-devel-104
This commit is contained in:
Stefan Metzmacher 2015-01-19 12:37:13 +01:00 committed by Michael Adam
parent c5cb1fb621
commit 6f5ed44322

View File

@ -130,10 +130,16 @@ struct tdb_wrap *tdb_wrap_open(TALLOC_CTX *mem_ctx,
struct tdb_wrap *result;
struct tdb_wrap_private *w;
if (name == NULL) {
errno = EINVAL;
return NULL;
}
/* If they specify a .ntdb extension, but the code hasn't been
* converted, we want to complain. */
if (name && strends(name, ".ntdb")) {
if (strends(name, ".ntdb")) {
DEBUG(2, ("tdb(%s): This code does not yet understand ntdb. Please report.\n", name));
errno = EINVAL;
return NULL;
}