Skip to content
Browse files

Include space for alignment in read buffer resize check

Change-Id: I0c7e2612b9b79cdd49096144aad5f0009bcb3857
http://code.google.com/p/android/issues/detail?id=15356
Bug: 4074737
  • Loading branch information...
1 parent 1537fcb commit f07bf9fa6a96c0039e832242569c8e6fc40c9a94 @bdcgoogle bdcgoogle committed Mar 10, 2011
Showing with 2 additions and 2 deletions.
  1. +1 −1 patches/small_records.patch
  2. +1 −1 ssl/s3_pkt.c
View
2 patches/small_records.patch
@@ -157,7 +157,7 @@
+ /* If we receive a valid record larger than the current buffer size,
+ * allocate some memory for it.
+ */
-+ if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH)
++ if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH - align)
+ {
+ if ((p=OPENSSL_realloc(s->s3->rbuf.buf, rr->length + SSL3_RT_HEADER_LENGTH + align))==NULL)
+ {
View
2 ssl/s3_pkt.c
@@ -359,7 +359,7 @@ fprintf(stderr, "Record type=%d, Length=%d\n", rr->type, rr->length);
/* If we receive a valid record larger than the current buffer size,
* allocate some memory for it.
*/
- if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH)
+ if (rr->length > s->s3->rbuf.len - SSL3_RT_HEADER_LENGTH - align)
{
if ((p=OPENSSL_realloc(s->s3->rbuf.buf, rr->length + SSL3_RT_HEADER_LENGTH + align))==NULL)
{

0 comments on commit f07bf9f

Please sign in to comment.
Something went wrong with that request. Please try again.