Pārlūkot izejas kodu

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.
Vincent Penquerc'h 10 gadi atpakaļ
vecāks
revīzija
a4b3a0c955
1 mainītis faili ar 1 papildinājumiem un 1 dzēšanām
  1. 1 1
      qubes-rpc/qopen-in-vm.c

+ 1 - 1
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)