summaryrefslogtreecommitdiff
path: root/source3/groupdb
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2011-11-28 10:44:42 +0100
committerVolker Lendecke <vlendec@samba.org>2011-11-28 12:24:08 +0100
commit0d4fc19ac764bc1b5b316867b50f7bc33cef9f9b (patch)
treee254e7e1d6782ee020866ee303c67eb734575f5c /source3/groupdb
parent0e526062a4716c01421ec45f2e0d5093c63ea5c5 (diff)
downloadsamba-0d4fc19ac764bc1b5b316867b50f7bc33cef9f9b.tar.gz
s3: Fix a crash in group_mapping.ldb->tdb conversion
When we find a group_mapping.ldb entry without a comment, the upgrade code would have crashed with a NULL dereference Autobuild-User: Volker Lendecke <vlendec@samba.org> Autobuild-Date: Mon Nov 28 12:24:08 CET 2011 on sn-devel-104
Diffstat (limited to 'source3/groupdb')
-rw-r--r--source3/groupdb/mapping_tdb.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c
index 394a2f0b223..1dea9e482e5 100644
--- a/source3/groupdb/mapping_tdb.c
+++ b/source3/groupdb/mapping_tdb.c
@@ -1006,6 +1006,19 @@ static int convert_ldb_record(TDB_CONTEXT *ltdb, TDB_DATA key,
TALLOC_FREE(name);
}
+ if (map->nt_name == NULL) {
+ errno = EIO;
+ goto failed;
+ }
+
+ if (map->comment == NULL) {
+ map->comment = talloc_strdup(map, "");
+ }
+ if (map->comment == NULL) {
+ errno = ENOMEM;
+ goto failed;
+ }
+
if (!add_mapping_entry(map, 0)) {
errno = EIO;
goto failed;