summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2016-11-02 10:34:12 +0000
committerMatt Caswell <matt@openssl.org>2016-11-02 16:51:58 +0000
commit0f6c9d73cb1e1027c67d993a669719e351c25cfc (patch)
tree014a23148afbb9662fc70ff1145f112a3fe93ab8 /test
parenta95a0219a887611ad8e246e33c086255df771072 (diff)
Fix read_ahead
The function ssl3_read_n() takes a parameter |clearold| which, if set, causes any old data in the read buffer to be forgotten, and any unread data to be moved to the start of the buffer. This is supposed to happen when we first read the record header. However, the data move was only taking place if there was not already sufficient data in the buffer to satisfy the request. If read_ahead is set then the record header could be in the buffer already from when we read the preceding record. So with read_ahead we can get into a situation where even though |clearold| is set, the data does not get moved to the start of the read buffer when we read the record header. This means there is insufficient room in the read buffer to consume the rest of the record body, resulting in an internal error. This commit moves the |clearold| processing to earlier in ssl3_read_n() to ensure that it always takes place. Reviewed-by: Richard Levitte <levitte@openssl.org> (cherry picked from commit a7faa6da317887e14e8e28254a83555983ed6ca7)
Diffstat (limited to 'test')
0 files changed, 0 insertions, 0 deletions