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

Side by Side Diff: core/fpdfapi/fpdf_page/fpdf_page_parser.cpp

Issue 1930743003: Fix stack overflow from nested arrays. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: unsigned 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 unified diff | Download patch
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('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 2014 PDFium Authors. All rights reserved. 1 // Copyright 2014 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/fpdf_page/pageint.h" 7 #include "core/fpdfapi/fpdf_page/pageint.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 586 matching lines...) Expand 10 before | Expand all | Expand 10 after
597 pDict->Release(); 597 pDict->Release();
598 return; 598 return;
599 } 599 }
600 } 600 }
601 if (type != CPDF_StreamParser::Name) { 601 if (type != CPDF_StreamParser::Name) {
602 break; 602 break;
603 } 603 }
604 CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1, 604 CFX_ByteString key((const FX_CHAR*)m_pSyntax->GetWordBuf() + 1,
605 m_pSyntax->GetWordSize() - 1); 605 m_pSyntax->GetWordSize() - 1);
606 std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj( 606 std::unique_ptr<CPDF_Object, ReleaseDeleter<CPDF_Object>> pObj(
607 m_pSyntax->ReadNextObject()); 607 m_pSyntax->ReadNextObject(false, 0));
608 if (!key.IsEmpty()) { 608 if (!key.IsEmpty()) {
609 uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0; 609 uint32_t dwObjNum = pObj ? pObj->GetObjNum() : 0;
610 if (dwObjNum) 610 if (dwObjNum)
611 pDict->SetAtReference(key, m_pDocument, dwObjNum); 611 pDict->SetAtReference(key, m_pDocument, dwObjNum);
612 else 612 else
613 pDict->SetAt(key, pObj.release()); 613 pDict->SetAt(key, pObj.release());
614 } 614 }
615 } 615 }
616 PDF_ReplaceAbbr(pDict); 616 PDF_ReplaceAbbr(pDict);
617 CPDF_Object* pCSObj = NULL; 617 CPDF_Object* pCSObj = NULL;
(...skipping 1092 matching lines...) Expand 10 before | Expand all | Expand 10 after
1710 } else { 1710 } else {
1711 PDF_ReplaceAbbr(pElement); 1711 PDF_ReplaceAbbr(pElement);
1712 } 1712 }
1713 } 1713 }
1714 break; 1714 break;
1715 } 1715 }
1716 default: 1716 default:
1717 break; 1717 break;
1718 } 1718 }
1719 } 1719 }
OLDNEW
« no previous file with comments | « no previous file | core/fpdfapi/fpdf_page/fpdf_page_parser_old.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698