From cade762cbfb5253526da0ffec7e7d12d12902bf6 Mon Sep 17 00:00:00 2001 From: Adam Langley Date: Mon, 16 Mar 2015 10:57:30 -0700 Subject: Switch an assert back to a check. The assert was supposed to be *added* in fcf25833 but instead replaced the check. Change-Id: I74d67f49a4375f6b9f1272cbfcf87a438b3b6f29 --- src/ssl/s3_pkt.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ssl') diff --git a/src/ssl/s3_pkt.c b/src/ssl/s3_pkt.c index 4263cb0..3a42c3a 100644 --- a/src/ssl/s3_pkt.c +++ b/src/ssl/s3_pkt.c @@ -202,6 +202,10 @@ int ssl3_read_n(SSL *s, int n, int max, int extend) { } assert(n <= (int)(rb->len - rb->offset)); + if (n > (int)(rb->len - rb->offset)) { + OPENSSL_PUT_ERROR(SSL, ssl3_read_n, ERR_R_INTERNAL_ERROR); + return -1; + } if (!s->read_ahead) { /* ignore max parameter */ -- cgit v1.1