cleanupdb: Fix a memory read error
authorHanno Böck <hanno@hboeck.de>
Wed, 19 Apr 2017 12:00:21 +0000 (14:00 +0200)
committerRalph Boehme <slow@samba.org>
Thu, 20 Apr 2017 14:53:17 +0000 (16:53 +0200)
Bug: https://bugzilla.samba.org/show_bug.cgi?id=12748

Signed-off-by: Hanno Böck <hanno@hboeck.de>
Reviewed-by: Volker Lendecke <vl@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
source3/lib/cleanupdb.c

index 8832abe..7bf7c7e 100644 (file)
@@ -61,7 +61,7 @@ bool cleanupdb_store_child(const pid_t pid, const bool unclean)
        struct cleanup_key key = { .pid = pid };
        struct cleanup_rec rec = { .pid = pid, .unclean = unclean };
        TDB_DATA tdbkey = { .dptr = (uint8_t *)&key, .dsize = sizeof(key) };
        struct cleanup_key key = { .pid = pid };
        struct cleanup_rec rec = { .pid = pid, .unclean = unclean };
        TDB_DATA tdbkey = { .dptr = (uint8_t *)&key, .dsize = sizeof(key) };
-       TDB_DATA tdbdata = { .dptr = (uint8_t *)&key, .dsize = sizeof(rec) };
+       TDB_DATA tdbdata = { .dptr = (uint8_t *)&rec, .dsize = sizeof(rec) };
        int result;
 
        db = cleanup_db();
        int result;
 
        db = cleanup_db();