summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYonit Halperin <yhalperi@redhat.com>2012-06-24 20:33:19 +0300
committerYonit Halperin <yhalperi@redhat.com>2012-07-03 14:13:40 +0300
commitb468f14e23a54e0e502aba59d6aaf4e797339845 (patch)
tree2af97665d9bb690ed5999a77e6510e1fe5e40ef1
parent3a4d54273b216063b483693dea29be10ff9b3c7e (diff)
smartcard: fix calc of remaining data size when reading more than one msg from the device
-rw-r--r--server/smartcard.c2
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);
}