mirror of
https://github.com/samba-team/samba.git
synced 2025-02-04 17:47:26 +03:00
ldb_tdb: Use memcmp() to compare TDB keys in re_index()
The keys may not always be a null terminated string, they could well be a binary GUID in a future revision, for efficiency.. BUG: https://bugzilla.samba.org/show_bug.cgi?id=13016 Signed-off-by: Andrew Bartlett <abartlet@samba.org> Reviewed-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
This commit is contained in:
parent
070f24bc9d
commit
da1e23418a
@ -1620,7 +1620,8 @@ static int re_index(struct tdb_context *tdb, TDB_DATA key, TDB_DATA data, void *
|
||||
talloc_free(msg);
|
||||
return 0;
|
||||
}
|
||||
if (strcmp((char *)key2.dptr, (char *)key.dptr) != 0) {
|
||||
if (key.dsize != key2.dsize ||
|
||||
(memcmp(key.dptr, key2.dptr, key.dsize) != 0)) {
|
||||
tdb_delete(tdb, key);
|
||||
tdb_store(tdb, key2, data, 0);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user