summaryrefslogtreecommitdiffstats
path: root/src/ssl
diff options
context:
space:
mode:
authorAdam Langley <agl@google.com>2015-03-16 10:57:30 -0700
committerAdam Langley <agl@google.com>2015-03-16 10:57:30 -0700
commitcade762cbfb5253526da0ffec7e7d12d12902bf6 (patch)
tree986dacec31305f4082c430732edeee6e39edb1bd /src/ssl
parenta4fb56a4374ac52a0b1c23e3654d4426c2e4adb3 (diff)
downloadexternal_boringssl-cade762cbfb5253526da0ffec7e7d12d12902bf6.zip
external_boringssl-cade762cbfb5253526da0ffec7e7d12d12902bf6.tar.gz
external_boringssl-cade762cbfb5253526da0ffec7e7d12d12902bf6.tar.bz2
Switch an assert back to a check.
The assert was supposed to be *added* in fcf25833 but instead replaced the check. Change-Id: I74d67f49a4375f6b9f1272cbfcf87a438b3b6f29
Diffstat (limited to 'src/ssl')
-rw-r--r--src/ssl/s3_pkt.c4
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 */