Fix a potential crash in PPM, in case of incomlete xml.
authorAnkur Bansal <ankur.b1@samsung.com>
Mon, 6 Jul 2015 12:07:32 +0000 (17:37 +0530)
committerUze Choi <uzchoi@samsung.com>
Tue, 7 Jul 2015 09:14:14 +0000 (09:14 +0000)
Handle the case when pluginInfo tag is missing in the Configuration
file.

Change-Id: I0bc8e14a875a71bd2254d5ef917b3dc7652339f8
Signed-off-by: Ankur Bansal <ankur.b1@samsung.com>
Reviewed-on: https://gerrit.iotivity.org/gerrit/1538
Tested-by: jenkins-iotivity <jenkins-iotivity@opendaylight.org>
Reviewed-by: Younghyun Joo <yh_.joo@samsung.com>
Reviewed-by: Uze Choi <uzchoi@samsung.com>
service/protocol-plugin/plugin-manager/src/Config.cpp

index b2e3044..c88859a 100644 (file)
@@ -132,6 +132,11 @@ PMRESULT Config::parsing(char *xmlData, xml_document<> *doc)
 
 PMRESULT Config::getXmlData(xml_node<> *pluginInfo, std::string key)
 {
+    if(pluginInfo == NULL)
+    {
+        return PM_S_FALSE;
+    }
+
     std::string value  = "";
     xml_attribute<> *iAttr = pluginInfo->first_attribute(key.c_str());
     if (iAttr)