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

Side by Side Diff: core/fpdfapi/page/cpdf_streamcontentparser.cpp

Issue 2686193003: [M57] Limit parsing recursion levels in CPDF_StreamParser (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/fpdfapi/page/cpdf_streamparser.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2016 PDFium Authors. All rights reserved. 1 // Copyright 2016 PDFium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com 5 // Original code copyright 2014 Foxit Software Inc. http://www.foxitsoftware.com
6 6
7 #include "core/fpdfapi/page/cpdf_streamcontentparser.h" 7 #include "core/fpdfapi/page/cpdf_streamcontentparser.h"
8 8
9 #include <memory> 9 #include <memory>
10 #include <utility> 10 #include <utility>
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 if (bsKeyword != "ID") { 637 if (bsKeyword != "ID") {
638 m_pSyntax->SetPos(savePos); 638 m_pSyntax->SetPos(savePos);
639 return; 639 return;
640 } 640 }
641 } 641 }
642 if (type != CPDF_StreamParser::Name) { 642 if (type != CPDF_StreamParser::Name) {
643 break; 643 break;
644 } 644 }
645 CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1, 645 CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1,
646 m_pSyntax->GetWordSize() - 1); 646 m_pSyntax->GetWordSize() - 1);
647 auto pObj = m_pSyntax->ReadNextObject(false, 0); 647 auto pObj = m_pSyntax->ReadNextObject(false, false, 0);
648 if (!key.IsEmpty()) { 648 if (!key.IsEmpty()) {
649 uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0; 649 uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0;
650 if (dwObjNum) 650 if (dwObjNum)
651 pDict->SetNewFor<CPDF_Reference>(key, m_pDocument, dwObjNum); 651 pDict->SetNewFor<CPDF_Reference>(key, m_pDocument, dwObjNum);
652 else 652 else
653 pDict->SetFor(key, std::move(pObj)); 653 pDict->SetFor(key, std::move(pObj));
654 } 654 }
655 } 655 }
656 ReplaceAbbr(pDict.get()); 656 ReplaceAbbr(pDict.get());
657 CPDF_Object* pCSObj = nullptr; 657 CPDF_Object* pCSObj = nullptr;
(...skipping 1001 matching lines...) Expand 10 before | Expand all | Expand 10 after
1659 if (!bProcessed) { 1659 if (!bProcessed) {
1660 m_pSyntax->SetPos(last_pos); 1660 m_pSyntax->SetPos(last_pos);
1661 return; 1661 return;
1662 } 1662 }
1663 } 1663 }
1664 } 1664 }
1665 1665
1666 CPDF_StreamContentParser::ContentParam::ContentParam() {} 1666 CPDF_StreamContentParser::ContentParam::ContentParam() {}
1667 1667
1668 CPDF_StreamContentParser::ContentParam::~ContentParam() {} 1668 CPDF_StreamContentParser::ContentParam::~ContentParam() {}
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/page/cpdf_streamparser.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698