From: Volker Lendecke Date: Thu, 16 May 2024 10:03:46 +0000 (+0200) Subject: smbd: Use direct struct initialization X-Git-Tag: tdb-1.4.11~624 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=9115836687f7980d4a1a0cea38262a7956e354fe;p=thirdparty%2Fsamba.git smbd: Use direct struct initialization Make sure all fields in the target struct are initialized Signed-off-by: Volker Lendecke Reviewed-by: Andrew Bartlett --- diff --git a/source3/locking/locking.c b/source3/locking/locking.c index 25735a3083d..41b54b14c6b 100644 --- a/source3/locking/locking.c +++ b/source3/locking/locking.c @@ -95,14 +95,16 @@ void init_strict_lock_struct(files_struct *fsp, { SMB_ASSERT(lock_type == READ_LOCK || lock_type == WRITE_LOCK); - plock->context.smblctx = smblctx; - plock->context.tid = fsp->conn->cnum; - plock->context.pid = messaging_server_id(fsp->conn->sconn->msg_ctx); - plock->start = start; - plock->size = size; - plock->fnum = fsp->fnum; - plock->lock_type = lock_type; - plock->lock_flav = lp_posix_cifsu_locktype(fsp); + *plock = (struct lock_struct) { + .context.smblctx = smblctx, + .context.tid = fsp->conn->cnum, + .context.pid = messaging_server_id(fsp->conn->sconn->msg_ctx), + .start = start, + .size = size, + .fnum = fsp->fnum, + .lock_type = lock_type, + .lock_flav = lp_posix_cifsu_locktype(fsp), + }; } bool strict_lock_check_default(files_struct *fsp, struct lock_struct *plock)