[PATCH spice-server 01/14] smartcard: fix calc of remaining data size when reading more than one msg from the device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



---
 server/smartcard.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/server/smartcard.c b/server/smartcard.c
index 8ded142..cb6b40b 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -107,7 +107,7 @@ void smartcard_char_device_wakeup(SpiceCharDeviceInstance *sin)
             continue;
         }
         smartcard_char_device_on_message_from_device(state, vheader);
-        remaining = state->buf_used - sizeof(VSCMsgHeader) > actual_length;
+        remaining = state->buf_used - sizeof(VSCMsgHeader) - actual_length;
         if (remaining > 0) {
             memcpy(state->buf, state->buf_pos, remaining);
         }
-- 
1.7.7.6

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/spice-devel


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]