{"id":1717,"url":"https://patchwork.libcamera.org/api/patches/1717/?format=json","web_url":"https://patchwork.libcamera.org/patch/1717/","project":{"id":1,"url":"https://patchwork.libcamera.org/api/projects/1/?format=json","name":"libcamera","link_name":"libcamera","list_id":"libcamera_core","list_email":"libcamera-devel@lists.libcamera.org","web_url":"","scm_url":"","webscm_url":""},"msgid":"<20190718050617.29455-1-kieran.bingham@ideasonboard.com>","date":"2019-07-18T05:06:17","name":"[libcamera-devel] libcamera: ipa_module: prevent uninitialised access","commit_ref":null,"pull_url":null,"state":"superseded","archived":false,"hash":"70fcc431328905dfb7ff3136ee03dca49acea6b2","submitter":{"id":4,"url":"https://patchwork.libcamera.org/api/people/4/?format=json","name":"Kieran Bingham","email":"kieran.bingham@ideasonboard.com"},"delegate":null,"mbox":"https://patchwork.libcamera.org/patch/1717/mbox/","series":[{"id":440,"url":"https://patchwork.libcamera.org/api/series/440/?format=json","web_url":"https://patchwork.libcamera.org/project/libcamera/list/?series=440","date":"2019-07-18T05:06:17","name":"[libcamera-devel] libcamera: ipa_module: prevent uninitialised access","version":1,"mbox":"https://patchwork.libcamera.org/series/440/mbox/"}],"comments":"https://patchwork.libcamera.org/api/patches/1717/comments/","check":"pending","checks":"https://patchwork.libcamera.org/api/patches/1717/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 3287960C00\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tThu, 18 Jul 2019 07:06:22 +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 9AEB431C;\n\tThu, 18 Jul 2019 07:06:21 +0200 (CEST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/simple; d=ideasonboard.com;\n\ts=mail; t=1563426381;\n\tbh=7UlcKjG4dyMPQwtYDjim2DusAjF5Qq0orp35UVyKOKg=;\n\th=From:To:Cc:Subject:Date:From;\n\tb=vDCYptfxK2/MvPcaK5pxIWx4F3F2EkWmBoGD6xROflSskZ9D8CRj1ZT2dvN7+EPWK\n\t0l0FLT5ShVUtAM54vJIZJzZdXndQHAeTvnVuKr8InUm3gmhlAIxYZzzcIOWGnUQd1x\n\tcc+9cQfHbkJWDyRUtylwbeaDP0zieITBdC4X7yOg=","From":"Kieran Bingham <kieran.bingham@ideasonboard.com>","To":"LibCamera Devel <libcamera-devel@lists.libcamera.org>","Date":"Thu, 18 Jul 2019 06:06:17 +0100","Message-Id":"<20190718050617.29455-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] 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, 18 Jul 2019 05:06:22 -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 anlaysers by initialising the data variable when it is\ndefined.\n\nSigned-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>\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..2ddb02c1562e 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 = NULL;\n \tsize_t dataSize;\n \tvoid *map;\n \tsize_t soSize;\n","prefixes":["libcamera-devel"]}