s3:locking: fix uninitialiazed variable in brl_get_locks_readonly_parser()
authorStefan Metzmacher <metze@samba.org>
Wed, 17 Dec 2014 09:43:33 +0000 (10:43 +0100)
committerStefan Metzmacher <metze@samba.org>
Thu, 18 Dec 2014 03:22:05 +0000 (04:22 +0100)
In a cluster this can be called with an empty record, while
brl_parse_data() relies on an initialized structure.

This is a regression in commit 837e29035c911f3509135252c3f423d0f56b606d.

Bug: https://bugzilla.samba.org/show_bug.cgi?id=10911

Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Jeremy Allison <jra@samba.org>
source3/locking/brlock.c

index 6c73c725dd1028901eac176af08bccf450d9d649..7fd3783cb869ea4264a652a77b1fd42af2d756cc 100644 (file)
@@ -2014,6 +2014,7 @@ static void brl_get_locks_readonly_parser(TDB_DATA key, TDB_DATA data,
                *state->br_lock = NULL;
                return;
        }
+       *br_lck = (struct byte_range_lock) {};
        if (!brl_parse_data(br_lck, data)) {
                *state->br_lock = NULL;
                return;