From a4b3a0c955058224a11c2aebf4f9f3d211364249 Mon Sep 17 00:00:00 2001 From: Vincent Penquerc'h Date: Sun, 29 Dec 2013 07:04:11 -0500 Subject: [PATCH] qopen-in-vm: ensure we can't mistake a non empty file for an empty one st_size is off_t, which may be larger than int. --- qubes-rpc/qopen-in-vm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qubes-rpc/qopen-in-vm.c b/qubes-rpc/qopen-in-vm.c index bffdd98..7c40de5 100644 --- a/qubes-rpc/qopen-in-vm.c +++ b/qubes-rpc/qopen-in-vm.c @@ -44,7 +44,7 @@ int copy_and_return_nonemptiness(int tmpfd) gui_fatal("fstat"); close(tmpfd); - return st.st_size; + return st.st_size > 0; } void recv_file_nowrite(char *fname)