From: Changgyu Choi Date: Thu, 24 Feb 2022 00:43:09 +0000 (+0900) Subject: Fix static analysis issue X-Git-Tag: accepted/tizen/6.5/unified/20220225.151944~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=61bc8b0ae15955585af3edbd1fd9d1c615e89301;p=platform%2Fcore%2Fappfw%2Flaunchpad.git Fix static analysis issue Changes: - Adds checking that the variable is nullptr. Change-Id: I632547066e972cf99d7f2c99b2464b39029e7b24 Signed-off-by: Changgyu Choi --- diff --git a/src/launchpad-parser/launchpad_parser_plugin.cc b/src/launchpad-parser/launchpad_parser_plugin.cc index 8ccee30..f873673 100644 --- a/src/launchpad-parser/launchpad_parser_plugin.cc +++ b/src/launchpad-parser/launchpad_parser_plugin.cc @@ -142,6 +142,9 @@ int LaunchpadParser::Upgrade(xmlDocPtr doc, std::string pkgid) { int LaunchpadParser::UnInstall(xmlDocPtr doc, std::string pkgid) { xmlNode* root = xmlDocGetRootElement(doc); + if (root == nullptr) + return -1; + for (xmlNode* node = root->children; node; node = node->next) { if (!node->name) continue;