commit | ef51a2d87a6ac68c74dbbbece1e968edb1a4c20f | [log] [tgz] |
---|---|---|
author | Tom Sepez <tsepez@chromium.org> | Sat Aug 27 02:19:12 2022 +0000 |
committer | Pdfium LUCI CQ <pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com> | Sat Aug 27 02:19:12 2022 +0000 |
tree | 5943e502e7c1af4092096383f002b277db7aef15 | |
parent | 9605f2f9c263f39897728ace0eed58ccd80a0349 [diff] |
Use Substr() in cpdf_syntax_parser.cpp Avoids pointer arithmetic in constructing a substring. Change-Id: I717cf9bd1eec8ec6e79d9767e1378d554e0e8173 Reviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/96970 Reviewed-by: Lei Zhang <thestig@chromium.org> Commit-Queue: Lei Zhang <thestig@chromium.org>
diff --git a/core/fpdfapi/parser/cpdf_syntax_parser.cpp b/core/fpdfapi/parser/cpdf_syntax_parser.cpp index 01210b9..ad1880d 100644 --- a/core/fpdfapi/parser/cpdf_syntax_parser.cpp +++ b/core/fpdfapi/parser/cpdf_syntax_parser.cpp
@@ -588,8 +588,7 @@ // `key` has to be "/X" at the minimum. if (key.GetLength() > 1) { - ByteString key_no_slash(key.raw_str() + 1, key.GetLength() - 1); - pDict->SetFor(key_no_slash, std::move(pObj)); + pDict->SetFor(key.Substr(1), std::move(pObj)); } }