diff options
author | Volker Lendecke <vl@samba.org> | 2011-11-28 10:44:42 +0100 |
---|---|---|
committer | Volker Lendecke <vlendec@samba.org> | 2011-11-28 12:24:08 +0100 |
commit | 0d4fc19ac764bc1b5b316867b50f7bc33cef9f9b (patch) | |
tree | e254e7e1d6782ee020866ee303c67eb734575f5c /source3/groupdb | |
parent | 0e526062a4716c01421ec45f2e0d5093c63ea5c5 (diff) | |
download | samba-0d4fc19ac764bc1b5b316867b50f7bc33cef9f9b.tar.gz samba-0d4fc19ac764bc1b5b316867b50f7bc33cef9f9b.tar.bz2 samba-0d4fc19ac764bc1b5b316867b50f7bc33cef9f9b.zip |
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.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/source3/groupdb/mapping_tdb.c b/source3/groupdb/mapping_tdb.c index 394a2f0b22..1dea9e482e 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; |