[Spice-devel] [PATCH spice-server 01/14] smartcard: fix calc of remaining data size when reading more than one msg from the device
Yonit Halperin
yhalperi at redhat.com
Wed Jun 27 08:16:39 PDT 2012
---
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
More information about the Spice-devel
mailing list