diff options
author | Amitay Isaacs <amitay@gmail.com> | 2017-09-11 14:05:17 +1000 |
---|---|---|
committer | Amitay Isaacs <amitay@samba.org> | 2017-09-14 14:49:15 +0200 |
commit | a878171cb432673f635a75cce0b72c92bb0d3ec7 (patch) | |
tree | 058a11e394dc1ab2b7b15bc97c83611dc7f06aab /ctdb | |
parent | 77c17b03cfc4734142fd86ba3cdd9663e75f34e3 (diff) | |
download | samba-a878171cb432673f635a75cce0b72c92bb0d3ec7.tar.gz |
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>
Diffstat (limited to 'ctdb')
-rw-r--r-- | ctdb/client/client_db.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ctdb/client/client_db.c b/ctdb/client/client_db.c index e3eaf7dd106..e86830e7bfb 100644 --- a/ctdb/client/client_db.c +++ b/ctdb/client/client_db.c @@ -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; |