Patch Detail
Show a patch.
GET /api/1.1/patches/17131/?format=api
{ "id": 17131, "url": "https://patchwork.libcamera.org/api/1.1/patches/17131/?format=api", "web_url": "https://patchwork.libcamera.org/patch/17131/", "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": "<20220816015414.7462-5-laurent.pinchart@ideasonboard.com>", "date": "2022-08-16T01:54:09", "name": "[libcamera-devel,v4,4/9] libcamera: yaml_parser: Fix bounds checking for 16-bit YamlObject::get()", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": false, "hash": "787f1f6e98a75c7965cd43b13230f38e2ce2c5c3", "submitter": { "id": 2, "url": "https://patchwork.libcamera.org/api/1.1/people/2/?format=api", "name": "Laurent Pinchart", "email": "laurent.pinchart@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/17131/mbox/", "series": [ { "id": 3418, "url": "https://patchwork.libcamera.org/api/1.1/series/3418/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=3418", "date": "2022-08-16T01:54:05", "name": "Add DPF tuning support for RkISP1", "version": 4, "mbox": "https://patchwork.libcamera.org/series/3418/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/17131/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/17131/checks/", "tags": {}, "headers": { "Return-Path": "<libcamera-devel-bounces@lists.libcamera.org>", "X-Original-To": "parsemail@patchwork.libcamera.org", "Delivered-To": "parsemail@patchwork.libcamera.org", "Received": [ "from lancelot.ideasonboard.com (lancelot.ideasonboard.com\n\t[92.243.16.209])\n\tby patchwork.libcamera.org (Postfix) with ESMTPS id 76FDFC3275\n\tfor <parsemail@patchwork.libcamera.org>;\n\tTue, 16 Aug 2022 01:54:37 +0000 (UTC)", "from lancelot.ideasonboard.com (localhost [IPv6:::1])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTP id 0801B61FC5;\n\tTue, 16 Aug 2022 03:54:37 +0200 (CEST)", "from perceval.ideasonboard.com (perceval.ideasonboard.com\n\t[213.167.242.64])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id F404861FBD\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tTue, 16 Aug 2022 03:54:33 +0200 (CEST)", "from pendragon.ideasonboard.com (62-78-145-57.bb.dnainternet.fi\n\t[62.78.145.57])\n\tby perceval.ideasonboard.com (Postfix) with ESMTPSA id 912D251C;\n\tTue, 16 Aug 2022 03:54:33 +0200 (CEST)" ], "DKIM-Signature": [ "v=1; a=rsa-sha256; c=relaxed/simple; d=libcamera.org;\n\ts=mail; t=1660614877;\n\tbh=IkepI4OpLEdCsj0gxeEvWVugmg3kTJKvXZusdraEcb4=;\n\th=To:Date:In-Reply-To:References:Subject:List-Id:List-Unsubscribe:\n\tList-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:\n\tFrom;\n\tb=d143DgPRRDdof+tY9ESvUH/nXkyUHBA98Q8QNdba5lA/afXv9beaoHLrgYwLSXQwT\n\ttreFykTd+vBue2l+0KBeXWVbA1adOt4cXlufxUgI/SF0GDyKrvWwYUDyVwMi3wrUgx\n\tW2wo3/1m+X3peRVIL2kH5b2cSUSPkAB2Nsk/vsbKld7OZ2qYfMHopvdHgglDRPlHBn\n\td2OGil1V6lMR4Uq8jiX42rWgg1HHtMB8ueUjgYJ86EFm67iddLM8M6f56lj6HGxDja\n\tpaptPNWP14BcjONoJ/iigxTj2oRdLDoD56icd5jse5V7JhvoniudcwgofZ7KcRAPNW\n\tIjqgtipCgWy7Q==", "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1660614873;\n\tbh=IkepI4OpLEdCsj0gxeEvWVugmg3kTJKvXZusdraEcb4=;\n\th=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n\tb=ae3M7qwlVOQ1L/hVEqdbFTQ+vyhdPOyJJn0hTZJ/FxxHckiYkPpi8b4ux0kFYzPC+\n\tZ/ECz8vAJGMxJ02cmshvUwcF5hVyeV8FepXE79Ka+MS805b2bsFxQKCMBQoxoRN3RT\n\tmCMcF/0D1ssZ5fNnQbNyzXBOs/wxNZyzJBoIFfm0=" ], "Authentication-Results": "lancelot.ideasonboard.com; dkim=pass (1024-bit key; \n\tunprotected) header.d=ideasonboard.com\n\theader.i=@ideasonboard.com\n\theader.b=\"ae3M7qwl\"; dkim-atps=neutral", "To": "libcamera-devel@lists.libcamera.org", "Date": "Tue, 16 Aug 2022 04:54:09 +0300", "Message-Id": "<20220816015414.7462-5-laurent.pinchart@ideasonboard.com>", "X-Mailer": "git-send-email 2.35.1", "In-Reply-To": "<20220816015414.7462-1-laurent.pinchart@ideasonboard.com>", "References": "<20220816015414.7462-1-laurent.pinchart@ideasonboard.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH v4 4/9] libcamera: yaml_parser: Fix bounds\n\tchecking for 16-bit YamlObject::get()", "X-BeenThere": "libcamera-devel@lists.libcamera.org", "X-Mailman-Version": "2.1.29", "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>", "From": "Laurent Pinchart via libcamera-devel\n\t<libcamera-devel@lists.libcamera.org>", "Reply-To": "Laurent Pinchart <laurent.pinchart@ideasonboard.com>", "Errors-To": "libcamera-devel-bounces@lists.libcamera.org", "Sender": "\"libcamera-devel\" <libcamera-devel-bounces@lists.libcamera.org>" }, "content": "The YamlObject::get() function specializations for 16-bit integers cast\nthe return value of strto(u)l() to a 16-bit integer, rendering the\nbounds checking useless. Fix them.\n\nFixes: c7d260c03abd (\"libcamera: yaml_parser: Add get() specializations for 16-bit integers\")\nSigned-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n---\n src/libcamera/yaml_parser.cpp | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp\nindex 9162e2250ed4..f928b7238a19 100644\n--- a/src/libcamera/yaml_parser.cpp\n+++ b/src/libcamera/yaml_parser.cpp\n@@ -143,7 +143,7 @@ std::optional<int16_t> YamlObject::get() const\n \tchar *end;\n \n \terrno = 0;\n-\tint16_t value = std::strtol(value_.c_str(), &end, 10);\n+\tlong value = std::strtol(value_.c_str(), &end, 10);\n \n \tif ('\\0' != *end || errno == ERANGE ||\n \t value < std::numeric_limits<int16_t>::min() ||\n@@ -176,7 +176,7 @@ std::optional<uint16_t> YamlObject::get() const\n \tchar *end;\n \n \terrno = 0;\n-\tuint16_t value = std::strtoul(value_.c_str(), &end, 10);\n+\tunsigned long value = std::strtoul(value_.c_str(), &end, 10);\n \n \tif ('\\0' != *end || errno == ERANGE ||\n \t value < std::numeric_limits<uint16_t>::min() ||\n", "prefixes": [ "libcamera-devel", "v4", "4/9" ] }