Can't check a size_t for < 0.
authorBen Laurie <ben@links.org>
Sat, 19 Jan 2013 15:00:27 +0000 (15:00 +0000)
committerBen Laurie <ben@links.org>
Sat, 19 Jan 2013 15:00:27 +0000 (15:00 +0000)
ssl/t1_lib.c

index 1d336c2149b4887337b695a41f02907f8487bd52..ff25151b32dd1ef1e51c006455f97113b34630aa 100644 (file)
@@ -1393,7 +1393,9 @@ unsigned char *ssl_add_clienthello_tlsext(SSL *s, unsigned char *p, unsigned cha
                 const unsigned short ext_len = 2;
                 const unsigned char list_len = 1;
 
-               if ((lenmax = limit - ret - 6) < 0) return NULL;
+               if (limit < ret + 6)
+                       return NULL;
+               lenmax = limit - ret - 6;
 
                s2n(TLSEXT_TYPE_server_authz, ret);
                 /* Extension length: 2 bytes */