From b468f14e23a54e0e502aba59d6aaf4e797339845 Mon Sep 17 00:00:00 2001 From: Yonit Halperin Date: Sun, 24 Jun 2012 20:33:19 +0300 Subject: [PATCH] smartcard: fix calc of remaining data size when reading more than one msg from the device --- server/smartcard.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/smartcard.c b/server/smartcard.c index 8ded1421..cb6b40bd 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); }