Patch Detail
Show a patch.
GET /api/patches/1380/?format=api
{ "id": 1380, "url": "https://patchwork.libcamera.org/api/patches/1380/?format=api", "web_url": "https://patchwork.libcamera.org/patch/1380/", "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": "<20190610134531.17316-1-niklas.soderlund@ragnatech.se>", "date": "2019-06-10T13:45:31", "name": "[libcamera-devel] libcamera: ipa_manager: Fix handling of unset LIBCAMERA_IPA_MODULE_PATH", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": false, "hash": "be7f2e02c75ec2519fd7c466e24814d6c601f55f", "submitter": { "id": 5, "url": "https://patchwork.libcamera.org/api/people/5/?format=api", "name": "Niklas Söderlund", "email": "niklas.soderlund@ragnatech.se" }, "delegate": null, "mbox": "https://patchwork.libcamera.org/patch/1380/mbox/", "series": [ { "id": 343, "url": "https://patchwork.libcamera.org/api/series/343/?format=api", "web_url": "https://patchwork.libcamera.org/project/libcamera/list/?series=343", "date": "2019-06-10T13:45:31", "name": "[libcamera-devel] libcamera: ipa_manager: Fix handling of unset LIBCAMERA_IPA_MODULE_PATH", "version": 1, "mbox": "https://patchwork.libcamera.org/series/343/mbox/" } ], "comments": "https://patchwork.libcamera.org/api/patches/1380/comments/", "check": "pending", "checks": "https://patchwork.libcamera.org/api/patches/1380/checks/", "tags": {}, "headers": { "Return-Path": "<niklas.soderlund@ragnatech.se>", "Received": [ "from vsp-unauthed02.binero.net (vsp-unauthed02.binero.net\n\t[195.74.38.227])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id 565C261942\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tMon, 10 Jun 2019 15:45:37 +0200 (CEST)", "from bismarck.berto.se (unknown [89.233.230.99])\n\tby bin-vsp-out-02.atm.binero.net (Halon) with ESMTPA\n\tid 04f24ce3-8b86-11e9-8d05-005056917f90;\n\tMon, 10 Jun 2019 15:45:36 +0200 (CEST)" ], "X-Halon-ID": "04f24ce3-8b86-11e9-8d05-005056917f90", "Authorized-sender": "niklas@soderlund.pp.se", "From": "=?utf-8?q?Niklas_S=C3=B6derlund?= <niklas.soderlund@ragnatech.se>", "To": "libcamera-devel@lists.libcamera.org", "Date": "Mon, 10 Jun 2019 15:45:31 +0200", "Message-Id": "<20190610134531.17316-1-niklas.soderlund@ragnatech.se>", "X-Mailer": "git-send-email 2.21.0", "MIME-Version": "1.0", "Content-Type": "text/plain; charset=UTF-8", "Content-Transfer-Encoding": "8bit", "Subject": "[libcamera-devel] [PATCH] libcamera: ipa_manager: Fix handling of\n\tunset LIBCAMERA_IPA_MODULE_PATH", "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": "Mon, 10 Jun 2019 13:45:37 -0000" }, "content": "If the environment variable LIBCAMERA_IPA_MODULE_PATH is not set\nutils::secure_getenv() will return a nullptr. Assigning a nullptr to a\nstd::string is not valid and results in a crash,\n\n terminate called after throwing an instance of 'std::logic_error'\n what(): basic_string::_M_construct null not valid\n\nFix this by first checking if the char array return from\nutils::secure_getenv() is empty before creating a std::string from it.\n\nSigned-off-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n---\n src/libcamera/ipa_manager.cpp | 5 +++--\n 1 file changed, 3 insertions(+), 2 deletions(-)", "diff": "diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp\nindex f689aa69b7284092..7ea7a8cbff5f15a0 100644\n--- a/src/libcamera/ipa_manager.cpp\n+++ b/src/libcamera/ipa_manager.cpp\n@@ -34,10 +34,11 @@ IPAManager::IPAManager()\n {\n \taddDir(IPA_MODULE_DIR);\n \n-\tstd::string modulePaths = utils::secure_getenv(\"LIBCAMERA_IPA_MODULE_PATH\");\n-\tif (modulePaths.empty())\n+\tconst char *envModulePaths = utils::secure_getenv(\"LIBCAMERA_IPA_MODULE_PATH\");\n+\tif (!envModulePaths)\n \t\treturn;\n \n+\tstd::string modulePaths = envModulePaths;\n \tfor (size_t pos = 0, delim = 0; delim != std::string::npos;\n \t pos = delim + 1) {\n \t\tdelim = modulePaths.find(':', pos);\n", "prefixes": [ "libcamera-devel" ] }