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

Hans de Goede hdegoede at redhat.com
Mon Jul 2 02:56:45 PDT 2012


Looks good, ack.

On 06/27/2012 05:16 PM, Yonit Halperin wrote:
> ---
>   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);
>           }
>



More information about the Spice-devel mailing list