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);