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

Side by Side Diff: core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp

Issue 1522283002: Fix another former FX_BSTRC usage with embedded NULs. (Closed) Base URL: https://pdfium.googlesource.com/pdfium@master
Patch Set: Created 5 years 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 | no next file » | 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 "parser_int.h" 7 #include "parser_int.h"
8 8
9 #include <set> 9 #include <set>
10 #include <utility> 10 #include <utility>
(...skipping 1164 matching lines...) Expand 10 before | Expand all | Expand 10 after
1175 if (pResult == NULL) { 1175 if (pResult == NULL) {
1176 return TRUE; 1176 return TRUE;
1177 } 1177 }
1178 if ((FX_FILESIZE*)pResult - (FX_FILESIZE*)m_SortedOffset.GetData() == 1178 if ((FX_FILESIZE*)pResult - (FX_FILESIZE*)m_SortedOffset.GetData() ==
1179 m_SortedOffset.GetSize() - 1) { 1179 m_SortedOffset.GetSize() - 1) {
1180 return FALSE; 1180 return FALSE;
1181 } 1181 }
1182 FX_FILESIZE size = ((FX_FILESIZE*)pResult)[1] - pos; 1182 FX_FILESIZE size = ((FX_FILESIZE*)pResult)[1] - pos;
1183 FX_FILESIZE SavedPos = m_Syntax.SavePos(); 1183 FX_FILESIZE SavedPos = m_Syntax.SavePos();
1184 m_Syntax.RestorePos(pos); 1184 m_Syntax.RestorePos(pos);
1185 bForm = m_Syntax.SearchMultiWord("/Form\0stream", TRUE, size) == 0; 1185 const char kFormStream[] = "/Form\0stream";
1186 const CFX_ByteStringC kFormStreamStr(kFormStream, sizeof(kFormStream) - 1);
1187 bForm = m_Syntax.SearchMultiWord(kFormStreamStr, TRUE, size) == 0;
1186 m_Syntax.RestorePos(SavedPos); 1188 m_Syntax.RestorePos(SavedPos);
1187 return TRUE; 1189 return TRUE;
1188 } 1190 }
1189 1191
1190 CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList, 1192 CPDF_Object* CPDF_Parser::ParseIndirectObject(CPDF_IndirectObjects* pObjList,
1191 FX_DWORD objnum, 1193 FX_DWORD objnum,
1192 PARSE_CONTEXT* pContext) { 1194 PARSE_CONTEXT* pContext) {
1193 if (objnum >= (FX_DWORD)m_CrossRef.GetSize()) 1195 if (objnum >= (FX_DWORD)m_CrossRef.GetSize())
1194 return nullptr; 1196 return nullptr;
1195 1197
(...skipping 3803 matching lines...) Expand 10 before | Expand all | Expand 10 after
4999 if (!m_pLinearizedDict) 5001 if (!m_pLinearizedDict)
5000 return -1; 5002 return -1;
5001 CPDF_Array* pRange = m_pLinearizedDict->GetArray("H"); 5003 CPDF_Array* pRange = m_pLinearizedDict->GetArray("H");
5002 if (!pRange) 5004 if (!pRange)
5003 return -1; 5005 return -1;
5004 CPDF_Object* pStreamLen = pRange->GetElementValue(1); 5006 CPDF_Object* pStreamLen = pRange->GetElementValue(1);
5005 if (!pStreamLen) 5007 if (!pStreamLen)
5006 return -1; 5008 return -1;
5007 return pStreamLen->GetInteger(); 5009 return pStreamLen->GetInteger();
5008 } 5010 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698