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

Alon Levy alevy at redhat.com
Thu Feb 3 11:02:58 PST 2011


---
 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
-- 
1.7.4



More information about the Spice-devel mailing list