From: Ben Laurie Date: Sat, 19 Jan 2013 15:00:27 +0000 (+0000) Subject: Can't check a size_t for < 0. X-Git-Tag: OpenSSL_1_0_2-beta1~452 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=9ccc6f438236dec159686a0a2590a25933de425b;p=oweals%2Fopenssl.git Can't check a size_t for < 0. --- diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index a2f5a7fa25..530b1b97ef 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1391,7 +1391,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 */