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

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

Issue 1968743002: Fix a potential UAF with FPDFAvail_IsLinearized(). (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Use cached result Created 4 years, 7 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 | « core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
diff --git a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
index 28ccccb6fc27f50cd4b6efd6266e60f189518de0..33b6b39323a667054fb12eea6f8dd43ba492528b 100644
--- a/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
+++ b/core/fpdfapi/fpdf_parser/cpdf_hint_tables.h
@@ -21,8 +21,8 @@ class CPDF_Stream;
class CPDF_HintTables {
public:
CPDF_HintTables(CPDF_DataAvail* pDataAvail, CPDF_Dictionary* pLinearized)
- : m_pLinearizedDict(pLinearized),
- m_pDataAvail(pDataAvail),
+ : m_pDataAvail(pDataAvail),
+ m_pLinearizedDict(pLinearized),
m_nFirstPageSharedObjs(0),
m_szFirstPageObjOffset(0) {}
~CPDF_HintTables();
@@ -47,8 +47,12 @@ class CPDF_HintTables {
int ReadPrimaryHintStreamOffset() const;
int ReadPrimaryHintStreamLength() const;
- CPDF_Dictionary* m_pLinearizedDict;
- CPDF_DataAvail* m_pDataAvail;
+ // Owner, outlives this object.
+ CPDF_DataAvail* const m_pDataAvail;
+
+ // Owned by |m_pDataAvail|.
+ CPDF_Dictionary* const m_pLinearizedDict;
+
uint32_t m_nFirstPageSharedObjs;
FX_FILESIZE m_szFirstPageObjOffset;
CFX_ArrayTemplate<uint32_t> m_dwDeltaNObjsArray;
« no previous file with comments | « core/fpdfapi/fpdf_parser/cpdf_data_avail.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698