summaryrefslogtreecommitdiff
path: root/extra/yassl
diff options
context:
space:
mode:
authorHarin Vadodaria <harin.vadodaria@oracle.com>2012-12-13 10:17:26 +0530
committerHarin Vadodaria <harin.vadodaria@oracle.com>2012-12-13 10:17:26 +0530
commit82aa38574be0d2f30a0a69b86223584d017a9eec (patch)
tree12ef3a2dbf8d6fb2bd3ce9089d31621597d4571d /extra/yassl
parentfb2f6bf31335c21c8aae5aecc862850afd4634d8 (diff)
downloadmariadb-git-82aa38574be0d2f30a0a69b86223584d017a9eec.tar.gz
Bug#15965288: BUFFER OVERFLOW IN YASSL FUNCTION
DOPROCESSREPLY() Description: Function DoProcessReply() calls function decrypt_message() in a while loop without performing a check on available buffer space. This can cause buffer overflow and crash the server. This patch is fix provided by Sawtooth to resolve the issue.
Diffstat (limited to 'extra/yassl')
-rw-r--r--extra/yassl/src/handshake.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/extra/yassl/src/handshake.cpp b/extra/yassl/src/handshake.cpp
index c1ee61d043e..c7dbaf86071 100644
--- a/extra/yassl/src/handshake.cpp
+++ b/extra/yassl/src/handshake.cpp
@@ -767,8 +767,14 @@ int DoProcessReply(SSL& ssl)
while (buffer.get_current() < hdr.length_ + RECORD_HEADER + offset) {
// each message in record, can be more than 1 if not encrypted
- if (ssl.getSecurity().get_parms().pending_ == false) // cipher on
+ if (ssl.getSecurity().get_parms().pending_ == false) { // cipher on
+ // sanity check for malicious/corrupted/illegal input
+ if (buffer.get_remaining() < hdr.length_) {
+ ssl.SetError(bad_input);
+ return 0;
+ }
decrypt_message(ssl, buffer, hdr.length_);
+ }
mySTL::auto_ptr<Message> msg(mf.CreateObject(hdr.type_));
if (!msg.get()) {