diff options
author | lloyd <[email protected]> | 2011-12-23 21:25:47 +0000 |
---|---|---|
committer | lloyd <[email protected]> | 2011-12-23 21:25:47 +0000 |
commit | ef8865f55419d8930f6f71acf89249175c23ab0e (patch) | |
tree | c48aac0ccf8edffd369b3cf634cd54521b49ddf1 | |
parent | f5c863cf97ea11876acad3c46fffca23685698aa (diff) |
Fix crash
-rw-r--r-- | src/tls/rec_read.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/tls/rec_read.cpp b/src/tls/rec_read.cpp index 4e5b69780..7e295f8a4 100644 --- a/src/tls/rec_read.cpp +++ b/src/tls/rec_read.cpp @@ -213,9 +213,14 @@ size_t Record_Reader::get_record(byte& msg_type, } else { + bool padding_good = true; + for(size_t i = 0; i != pad_size; ++i) if(plaintext[plaintext.size()-i-1] != pad_value) - pad_size = 0; + padding_good = false; + + if(!padding_good) + pad_size = 0; } } |