[gtk+] broadway: Use explicit sizes for payload length



commit 9782a2b7293b99face96186b6fc2032dfbcbb0cb
Author: Benjamin Otte <otte redhat com>
Date:   Sun Mar 20 05:50:53 2016 +0100

    broadway: Use explicit sizes for payload length
    
    The previous greater than comparisons would never trigger the 2nd case.
    
    http://www.viva64.com/en/b/0383/

 gdk/broadway/broadway-server.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gdk/broadway/broadway-server.c b/gdk/broadway/broadway-server.c
index 9e659ff..3d5f29b 100644
--- a/gdk/broadway/broadway-server.c
+++ b/gdk/broadway/broadway-server.c
@@ -577,14 +577,14 @@ parse_input (BroadwayInput *input)
       is_mask = buf[1] & 0x80;
       data = buf + 2;
 
-      if (payload_len > 125)
+      if (payload_len == 126)
         {
           if (len < 4)
             return;
           payload_len = GUINT16_FROM_BE( *(guint16 *) data );
           data += 2;
         }
-      else if (payload_len > 126)
+      else if (payload_len == 127)
         {
           if (len < 10)
             return;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]