From f3a5d3ddf7b492e5e8f64cb2ee98a53b5520499d Mon Sep 17 00:00:00 2001 From: Tom Sepez Date: Wed, 29 Oct 2014 15:31:20 -0700 Subject: Resolve compilation error with G++ 4.9. Add a check for zero-length keys to avoid hitting the equivalent of |""[1]|. BUG=https://code.google.com/p/pdfium/issues/detail?id=58 R=jun_fang@foxitsoftware.com Review URL: https://codereview.chromium.org/665223003 --- core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp index e9c0fdd227..5df4a6ff7f 100644 --- a/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp +++ b/core/src/fpdfapi/fpdf_parser/fpdf_parser_parser.cpp @@ -2192,9 +2192,7 @@ CPDF_Object* CPDF_SyntaxParser::GetObject(CPDF_IndirectObjects* pObjList, FX_DWO if (pObj == NULL) { continue; } - if (key.GetLength() == 1) { - pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength() - 1), pObj); - } else { + if (key.GetLength() >= 1) { if (nKeys < 32) { pDict->SetAt(CFX_ByteStringC(((FX_LPCSTR)key) + 1, key.GetLength() - 1), pObj); } else { -- cgit v1.2.3