1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-22 13:34:15 +03:00

ctdb-client: Initialize ctdb_ltdb_header completely for empty record

ctdb_ltdb_fetch() only fills in relevant portion of ctdb_ltdb_header
if the record does not exist.  This can result in uninitialized writes
to ctdb_rec_buffer.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
This commit is contained in:
Amitay Isaacs 2017-09-11 14:05:17 +10:00 committed by Amitay Isaacs
parent 77c17b03cf
commit a878171cb4

View File

@ -1116,9 +1116,9 @@ int ctdb_ltdb_fetch(struct ctdb_db_context *db, TDB_DATA key,
return EIO;
}
header->rsn = 0;
header->dmaster = CTDB_UNKNOWN_PNN;
header->flags = 0;
*header = (struct ctdb_ltdb_header) {
.dmaster = CTDB_UNKNOWN_PNN,
};
if (data != NULL) {
*data = tdb_null;