[Spice-devel] [PATCH 7/8] server/smartcard: print instead of assert on bad reader_id in smartcard_char_device_on_message_from_device

Hans de Goede hdegoede at redhat.com
Fri Feb 4 00:43:35 PST 2011


Ack.

On 02/03/2011 08:02 PM, Alon Levy wrote:
> ---
>   server/smartcard.c |    4 +++-
>   1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/server/smartcard.c b/server/smartcard.c
> index db6ad68..65164c8 100644
> --- a/server/smartcard.c
> +++ b/server/smartcard.c
> @@ -114,7 +114,9 @@ void smartcard_char_device_on_message_from_device(
>               break;
>       }
>       /* We pass any VSC_Error right now - might need to ignore some? */
> -    ASSERT(state->reader_id != VSCARD_UNDEFINED_READER_ID);
> +    if (state->reader_id == VSCARD_UNDEFINED_READER_ID&&  vheader->type != VSC_Init) {
> +        red_printf("error: reader_id not assigned for message of type %d", vheader->type);
> +    }
>       ASSERT(g_smartcard_channel != NULL);
>       sent_header = spice_memdup(vheader, sizeof(*vheader) + vheader->length);
>       /* We patch the reader_id, since the device only knows about itself, and


More information about the Spice-devel mailing list