On 01/08/2015 03:53 AM, Uri Lublin wrote:
Hi Jeremy,

Ack.

Thanks.


h->length is unsigned.
1. Why is there a need to check that h->length > 0 ?

There is no need, changed.

2. What happens if h->length == 0 ?

Note that I believe that could only occur in the case of a malicious or buggy packet. By inspection, I believe the code will all function correctly; passing a 0 length atr along.

+static void process_apdu(smartcard_ccid_t *ccid, VSCMsgHeader *h,
char *data)
+{
+    if (ccid->state & STATE_READER_ADDED)
+        push_apdu(ccid, data, h->length);

Maybe add: else { fprintf(stderr, "warning ..." }

Sure.

Cheers,

Jeremy
_______________________________________________
Spice-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/spice-devel

Reply via email to