Show a patch.

GET /api/1.1/patches/1716/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 1716,
    "url": "https://patchwork.libcamera.org/api/1.1/patches/1716/?format=api",
    "web_url": "https://patchwork.libcamera.org/patch/1716/",
    "project": {
        "id": 1,
        "url": "https://patchwork.libcamera.org/api/1.1/projects/1/?format=api",
        "name": "libcamera",
        "link_name": "libcamera",
        "list_id": "libcamera_core",
        "list_email": "libcamera-devel@lists.libcamera.org",
        "web_url": "",
        "scm_url": "",
        "webscm_url": ""
    },
    "msgid": "<20190718042805.26595-1-kieran.bingham@ideasonboard.com>",
    "date": "2019-07-18T04:28:05",
    "name": "[libcamera-devel] test: camera: buffer_import: clear video pointer",
    "commit_ref": "1a6b80e4a0fa7b2be8fa6c4a25a33f92ce66f563",
    "pull_url": null,
    "state": "accepted",
    "archived": false,
    "hash": "099548ecfdec98c09490707105b93b9804f38de2",
    "submitter": {
        "id": 4,
        "url": "https://patchwork.libcamera.org/api/1.1/people/4/?format=api",
        "name": "Kieran Bingham",
        "email": "kieran.bingham@ideasonboard.com"
    },
    "delegate": null,
    "mbox": "https://patchwork.libcamera.org/patch/1716/mbox/",
    "series": [
        {
            "id": 439,
            "url": "https://patchwork.libcamera.org/api/1.1/series/439/?format=api",
            "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=439",
            "date": "2019-07-18T04:28:05",
            "name": "[libcamera-devel] test: camera: buffer_import: clear video pointer",
            "version": 1,
            "mbox": "https://patchwork.libcamera.org/series/439/mbox/"
        }
    ],
    "comments": "https://patchwork.libcamera.org/api/patches/1716/comments/",
    "check": "pending",
    "checks": "https://patchwork.libcamera.org/api/patches/1716/checks/",
    "tags": {},
    "headers": {
        "Return-Path": "<kieran.bingham@ideasonboard.com>",
        "Received": [
            "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[IPv6:2001:4b98:dc2:55:216:3eff:fef7:d647])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 9242F60C00\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Jul 2019 06:28:09 +0200 (CEST)",
            "from localhost.localdomain\n\t(cpc89242-aztw30-2-0-cust488.18-1.cable.virginm.net [86.31.129.233])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id E95AA31C;\n\tThu, 18 Jul 2019 06:28:08 +0200 (CEST)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1563424089;\n\tbh=uXmmhuX/O3zhw/vaKMrDAsM2Alhe4WV4ESxtisdHgmM=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=iulhCNABBr1GnEm6S0+x7nrjqoImntfw7/YHO1uKQJp/6kV7kuLoJKnk2n/IL8JCU\n\tmjEsvronoaoTQGsSWN9LQhdBSvE0/U81Y8BPlaFT/bGAzpEcZcb69OIOvwyAUv6CtN\n\ta4cam8uMMyK3wrwxdJnzZfSrqBrZE616moDXvr2Y=",
        "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>",
        "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>",
        "Date": "Thu, 18 Jul 2019 05:28:05 +0100",
        "Message-Id": "<20190718042805.26595-1-kieran.bingham@ideasonboard.com>",
        "X-Mailer": "git-send-email 2.20.1",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[libcamera-devel] [PATCH] test: camera: buffer_import: clear video\n\tpointer",
        "X-BeenThere": "libcamera-devel@lists.libcamera.org",
        "X-Mailman-Version": "2.1.23",
        "Precedence": "list",
        "List-Id": "<libcamera-devel.lists.libcamera.org>",
        "List-Unsubscribe": "<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>",
        "List-Archive": "<https://lists.libcamera.org/pipermail/libcamera-devel/>",
        "List-Post": "<mailto:libcamera-devel@lists.libcamera.org>",
        "List-Help": "<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>",
        "List-Subscribe": "<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>",
        "X-List-Received-Date": "Thu, 18 Jul 2019 04:28:09 -0000"
    },
    "content": "The FrameSink::cleanup() call checks if video_ is set before cleaning up\nand then deleting the object.\n\nIf the cleanup() call is called twice for any reason, this will\nencounter a use-after-free as the video_ pointer is not cleared after\ndeletion.\n\nWhilst cleanup() is not currently called twice consecutively, to prevent\nerrors in the future, make it explicit that the object has been deleted\nby clearing the stale pointer.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n---\n test/camera/buffer_import.cpp | 2 ++\n 1 file changed, 2 insertions(+)",
    "diff": "diff --git a/test/camera/buffer_import.cpp b/test/camera/buffer_import.cpp\nindex d6e4fd5bf6ad..400d02b350c1 100644\n--- a/test/camera/buffer_import.cpp\n+++ b/test/camera/buffer_import.cpp\n@@ -109,7 +109,9 @@ public:\n \t\t\tvideo_->streamOff();\n \t\t\tvideo_->releaseBuffers();\n \t\t\tvideo_->close();\n+\n \t\t\tdelete video_;\n+\t\t\tvideo_ = nullptr;\n \t\t}\n \n \t\tif (media_)\n",
    "prefixes": [
        "libcamera-devel"
    ]
}