Patch Detail
Show a patch.
GET /api/patches/1720/?format=api
{ "id": 1720, "url": "https://patchwork.libcamera.org/api/patches/1720/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1720/", "project": { "id": 1, "url": "https://patchwork.libcamera.org/api/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": "<20190801113850.4920-1-kieran.bingham@ideasonboard.com>", "date": "2019-08-01T11:38:50", "name": "[libcamera-devel,v2] libcamera: ipa_module: prevent uninitialised access", "commit_ref": "9ecc60e10c96d1abd7d68899831e3ab143a16520", "pull_url": null, "state": "accepted", "archived": false, "hash": "69a1dff8fcaac5c0f6ea89debdb25ec91c3b79ca", "submitter": { "id": 4, "url": "https://patchwork.libcamera.org/api/people/4/?format=api", "name": "Kieran Bingham", "email": "kieran.bingham@ideasonboard.com" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1720/mbox/", "series": [ { "id": 443, "url": "https://patchwork.libcamera.org/api/series/443/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=443", "date": "2019-08-01T11:38:50", "name": "[libcamera-devel,v2] libcamera: ipa_module: prevent uninitialised access", "version": 2, "mbox": "https://patchwork.libcamera.org/series/443/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1720/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1720/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 98520615DF\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 1 Aug 2019 13:38:55 +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 08079CC;\n\tThu, 1 Aug 2019 13:38:54 +0200 (CEST)" ], "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1564659535;\n\tbh=I/2O4IKzSCl8O6/SLLWnJJQkunL5UitqfnIeOhzHG18=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=iKsSikbXr/zc+p96gvGBHQ2BIpOJ1Hb61ixGo5RGNzFqel2c7JsPWeh1RpiwowAJA\n\t1oMEqjBdK0bpRMZfoegMNFpLW6zXyjoZZ5ZEJJ6oELQ1d9YDJzmrnNtapSTmwJU5nV\n\tXXFiJJ1ymT+lsnkPc5gsokMIbbQ8CeCK2FxNOb/0=", "From": "Kieran Bingham <kieran.bingham@ideasonboard.com>", "To": "LibCamera Devel <libcamera-devel@lists.libcamera.org>", "Date": "Thu, 1 Aug 2019 12:38:50 +0100", "Message-Id": "<20190801113850.4920-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 v2] libcamera: ipa_module: prevent\n\tuninitialised access", "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, 01 Aug 2019 11:38:55 -0000" }, "content": "The IPAModule::loadIPAModuleInfo() function includes a *data pointer\nwhich is used as a null-pointer comparison in the error path with a\nconditional statement of \"if (ret || !data)\".\n\nThe data variable is not initialised, and a single error path evaluates\nthis as \"if (true || uninitialised)\".\n\nWhilst this error path does not incorrectly utilise the uninitialised\ndata, as the ret evaluates to true already, it does leave a statement\nwhich includes an uninitialised variable.\n\nHelp the static analysers by initialising the data variable when it is\ndefined.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\n\n---\nv2:\n - s/NULL/nullptr/\n - Fix spelling in commit-message\n\n src/libcamera/ipa_module.cpp | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)", "diff": "diff --git a/src/libcamera/ipa_module.cpp b/src/libcamera/ipa_module.cpp\nindex 003611625214..99d308efd47b 100644\n--- a/src/libcamera/ipa_module.cpp\n+++ b/src/libcamera/ipa_module.cpp\n@@ -291,7 +291,7 @@ int IPAModule::loadIPAModuleInfo()\n \t\treturn ret;\n \t}\n \n-\tvoid *data;\n+\tvoid *data = nullptr;\n \tsize_t dataSize;\n \tvoid *map;\n \tsize_t soSize;\n", "prefixes": [ "libcamera-devel", "v2" ] }