[Spice-devel] [PATCH spice 09/12] VSCMsgHeader.reader_id is unsigned, so don't check for >= 0

Daniel P. Berrange berrange at redhat.com
Mon Apr 2 04:23:44 PDT 2012


From: "Daniel P. Berrange" <berrange at redhat.com>

* server/smartcard.c: Fix assertion to not check for >= 0 on
  unsigned variable

Signed-off-by: Daniel P. Berrange <berrange at redhat.com>
---
 server/smartcard.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

diff --git a/server/smartcard.c b/server/smartcard.c
index 805cb6e..eb2823a 100644
--- a/server/smartcard.c
+++ b/server/smartcard.c
@@ -428,8 +428,7 @@ static void smartcard_channel_write_to_reader(VSCMsgHeader *vheader)
     uint32_t n;
     uint32_t actual_length = vheader->length;
 
-    spice_assert(vheader->reader_id >= 0 &&
-           vheader->reader_id <= g_smartcard_readers.num);
+    spice_assert(vheader->reader_id <= g_smartcard_readers.num);
     sin = g_smartcard_readers.sin[vheader->reader_id];
     sif = SPICE_CONTAINEROF(sin->base.sif, SpiceCharDeviceInterface, base);
     /* protocol requires messages to be in network endianess */
-- 
1.7.7.6



More information about the Spice-devel mailing list