]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
block/nfs: fix int overflow in nfs_client_open_qdict
authorPeter Lieven <pl@kamp.de>
Wed, 9 Dec 2020 12:17:35 +0000 (13:17 +0100)
committerKevin Wolf <kwolf@redhat.com>
Fri, 18 Dec 2020 10:48:39 +0000 (11:48 +0100)
nfs_client_open returns the file size in sectors. This effectively
makes it impossible to open files larger than 1TB.

Fixes: c22a03454544c2a08f1107c5cc8481a5574533d5
Cc: qemu-stable@nongnu.org
Signed-off-by: Peter Lieven <pl@kamp.de>
Message-Id: <20201209121735.16437-1-pl@kamp.de>
Reviewed-by: Stefano Garzarella <sgarzare@redhat.com>
Signed-off-by: Kevin Wolf <kwolf@redhat.com>
block/nfs.c

index 77905f516d203d03012cdf362daf8d08d2a7397c..8c1968bb415d9a9e542988fd51128b9f302caa1c 100644 (file)
@@ -592,7 +592,7 @@ static int64_t nfs_client_open_qdict(NFSClient *client, QDict *options,
                                      int flags, int open_flags, Error **errp)
 {
     BlockdevOptionsNfs *opts;
-    int ret;
+    int64_t ret;
 
     opts = nfs_options_qdict_to_qapi(options, errp);
     if (opts == NULL) {