From: Luis Henriques Date: Fri, 31 Jan 2025 15:26:20 +0000 (+0000) Subject: fuse_lowlevel.c: fix possible 64 bits value truncation X-Git-Tag: fuse-3.17.1-rc0~10 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=dce6f59b106bccaba63bd1386138ab539864be89;p=qemu-gpiodev%2Flibfuse.git fuse_lowlevel.c: fix possible 64 bits value truncation Because conn.want_ext is a uint64_t, copying it into a uint32_t may result in truncating it's value. This patch fixes a bug in do_init() where the 32 bits copy is again converted into a 64 bits value, because it will be used in convert_to_conn_want_ext(). Signed-off-by: Luis Henriques --- diff --git a/lib/fuse_lowlevel.c b/lib/fuse_lowlevel.c index c993860..36baaa6 100644 --- a/lib/fuse_lowlevel.c +++ b/lib/fuse_lowlevel.c @@ -2178,7 +2178,7 @@ void do_init(fuse_req_t req, fuse_ino_t nodeid, const void *inarg) se->got_init = 1; if (se->op.init) { - uint32_t want_ext_default = se->conn.want_ext; + uint64_t want_ext_default = se->conn.want_ext; int rc; // Apply the first 32 bits of capable_ext to capable