Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2663)

Unified Diff: core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp

Issue 2283893003: Add some limit checks to ReadSharedObjHintTable(). (Closed)
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
index 4363d3924c9054b7e502efc5ce8f93a1af84b2c2..fd8765a2d210aad572635feb1346fa53c72478c6 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.cpp
@@ -278,6 +278,12 @@ bool CPDF_HintTables::ReadSharedObjHintTable(CFX_BitStream* hStream,
// greatest and least length of a shared object group, in bytes.
uint32_t dwDeltaGroupLen = hStream->GetBits(16);
+ if (dwFirstSharedObjNum >= CPDF_Parser::kMaxObjectNumber ||
+ m_nFirstPageSharedObjs >= CPDF_Parser::kMaxObjectNumber ||
+ dwSharedObjTotal >= CPDF_Parser::kMaxObjectNumber) {
+ return false;
+ }
+
int nFirstPageObjNum = GetFirstPageObjectNumber();
if (nFirstPageObjNum < 0)
return false;
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_parser/cpdf_parser.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698