)]}'
{
  "commit": "6d0a3d5365d04967d67399617acc16bc7e7efe52",
  "tree": "6f51f252f7f11f2cf7c450c238a713dd64806f7e",
  "parents": [
    "93797296015034f67cbb4464b947544ce9e8cd25"
  ],
  "author": {
    "name": "Lei Zhang",
    "email": "thestig@chromium.org",
    "time": "Mon Sep 19 18:47:13 2022 +0000"
  },
  "committer": {
    "name": "Pdfium LUCI CQ",
    "email": "pdfium-scoped@luci-project-accounts.iam.gserviceaccount.com",
    "time": "Mon Sep 19 18:47:13 2022 +0000"
  },
  "message": "M107: Copy data in CPDF_SyntaxParser::ReadStream().\n\nPreviously, https://pdfium-review.googlesource.com/97491 changed\nCPDF_ObjectStream to avoid copying. CPDF_ObjectStream now holds on to\nboth the data object, and a data stream that references the data object.\nThe data stream is expected to be destroyed before the data object, to\navoid dangling pointers.\n\nCPDF_ObjectStream then allows CPDF_SyntaxParser an only\nCPDF_SyntaxParser to use the data stream. Sometimes CPDF_SyntaxParser\ncreates new objects that references the data stream, Thereby violating\nthe object lifetime requirement that CPDF_ObjectStream was expecting.\n\nFix this issue by doing a data copy in CPDF_SyntaxParser::ReadStream()\nonly when needed. This copies less data than the previous strategy where\nCPDF_ObjectStream does the copying because:\n1) CPDF_SyntaxParser only copies in certain cases.\n2) CPDF_SyntaxParser copies a substream, which is oftentimes smaller\n   than the stream data that CPDF_ObjectStream copies.\n\nThis also prevents similar issues from happening when other objects\ninstantiates CPDF_SyntaxParser.\n\nFor the M107 merge, switch to using DataVector, as FixedUninitDataVector\ndid not make the M107 cut.\n\nBug: chromium:1364735\nChange-Id: Iacf7c3c1ae1a3f97882e52fbacfc68a7ed9d146a\nReviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/98091\nReviewed-by: Tom Sepez \u003ctsepez@chromium.org\u003e\nCommit-Queue: Lei Zhang \u003cthestig@chromium.org\u003e\n(cherry picked from commit a52ea7f7b8a6ad60e553ccea8c01ec17bde5825b)\nReviewed-on: https://pdfium-review.googlesource.com/c/pdfium/+/98152\n",
  "tree_diff": [
    {
      "type": "modify",
      "old_id": "c3a01cb2381eba2c137b45fed8a358436052050f",
      "old_mode": 33188,
      "old_path": "core/fpdfapi/parser/cpdf_syntax_parser.cpp",
      "new_id": "473c0070462f8c87beb13d2d3fe3b99bf1a14613",
      "new_mode": 33188,
      "new_path": "core/fpdfapi/parser/cpdf_syntax_parser.cpp"
    }
  ]
}
