Forráskód Böngészése

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 éve
szülő
commit
a4b3a0c955
1 módosított fájl, 1 hozzáadás és 1 törlés
  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)