PFW: Prevent crash if subsystem structure missing
BZ: 62524
If the XML file defining a subsystem is missing, the PFW crashes
without any message.
This patch fixes this issue.
Change-Id: Ibc0e9d195a8207d41d25613f56d1c9740bf6c784
Signed-off-by: Frédéric Boisnard <fredericx.boisnard@intel.com>
Reviewed-on: http://android.intel.com:8080/70698
Reviewed-by: Denneulin, Guillaume <guillaume.denneulin@intel.com>
Reviewed-by: Rocard, KevinX <kevinx.rocard@intel.com>
Reviewed-by: Centelles, Sylvain <sylvain.centelles@intel.com>
Reviewed-by: Baron, Georges-henriX <georges-henrix.baron@intel.com>
Tested-by: Dixon, CharlesX <charlesx.dixon@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/xmlserializer/XmlStringDocSink.cpp b/xmlserializer/XmlStringDocSink.cpp
index a96a1ed..c38036d 100644
--- a/xmlserializer/XmlStringDocSink.cpp
+++ b/xmlserializer/XmlStringDocSink.cpp
@@ -41,6 +41,11 @@
int iSize;
xmlDocDumpFormatMemoryEnc(xmlDocSource.getDoc(), &pcDumpedDoc, &iSize, "UTF-8", 1);
+ if (!pcDumpedDoc) {
+
+ return false;
+ }
+
_strResult.append((const char*)pcDumpedDoc);
xmlFree(pcDumpedDoc);