diff options
Diffstat (limited to 'src/ssl/s3_pkt.c')
-rw-r--r-- | src/ssl/s3_pkt.c | 4 |
1 files changed, 4 insertions, 0 deletions
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 */ |