From 87750b433a5d2d252ee5bd879cae553c046fd0e7 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Fri, 20 Jun 2014 12:00:00 -0700 Subject: [PATCH] Added OPENSSL_assert check as per PR#3377 reported by Rainer Jung (Imported from upstream's 955bfbc2686153b50aebb045a42d96e5b026e29c) --- ssl/s3_pkt.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ssl/s3_pkt.c b/ssl/s3_pkt.c index 874665b11..a308eadda 100644 --- a/ssl/s3_pkt.c +++ b/ssl/s3_pkt.c @@ -108,6 +108,7 @@ #include #include +#include #include #include @@ -576,6 +577,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len) int i; s->rwstate=SSL_NOTHING; + assert(s->s3->wnum <= INT_MAX); tot=s->s3->wnum; s->s3->wnum=0; @@ -599,7 +601,7 @@ int ssl3_write_bytes(SSL *s, int type, const void *buf_, int len) * buffer ... so we trap and report the error in a way the user * will notice */ - if ( len < tot) + if (len < tot) { OPENSSL_PUT_ERROR(SSL, ssl3_write_bytes, SSL_R_BAD_LENGTH); return(-1);