commit | 59d21660a3d91d9b340fdb0211e20358806590e1 | [log] [tgz] |
---|---|---|
author | Henrique Nakashima <hnakashima@chromium.org> | Thu Sep 06 17:30:56 2018 +0000 |
committer | Chromium commit bot <commit-bot@chromium.org> | Thu Sep 06 17:30:56 2018 +0000 |
tree | 94839c96602a42df67535eef118eb11141dcb1e0 | |
parent | ad370480282dd788afc80563cebb492c02644998 [diff] |
Fix integer overflow in LoadCryptInfo. Bug: 847283 Change-Id: I7951103a5a425407b5375460a5556e8765430740 Reviewed-on: https://pdfium-review.googlesource.com/42090 Reviewed-by: Ryan Harrison <rharrison@chromium.org> Commit-Queue: Henrique Nakashima <hnakashima@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_security_handler.cpp b/core/fpdfapi/parser/cpdf_security_handler.cpp index bc72ad3..f3d9201 100644 --- a/core/fpdfapi/parser/cpdf_security_handler.cpp +++ b/core/fpdfapi/parser/cpdf_security_handler.cpp
@@ -157,6 +157,9 @@ } else { nKeyBits = pEncryptDict->GetIntegerFor("Length", 256); } + if (nKeyBits < 0) + return false; + if (nKeyBits < 40) { nKeyBits *= 8; }