Coverity: Potential crash (?)

Change-Id: I819b0df446cf95d511d6a7a5a65c381a2a837d00
This commit is contained in:
Fridrich Štrba 2014-01-21 08:44:45 +01:00
parent d67c311983
commit 7989850e9f
2 changed files with 12 additions and 0 deletions

View File

@ -13,6 +13,7 @@ $(eval $(call gb_UnpackedTarball_set_tarball,libabw,$(ABW_TARBALL)))
$(eval $(call gb_UnpackedTarball_add_patches,libabw,\
external/libabw/libabw-0.0.1-inttypes.patch.1 \
external/libabw/libabw-0.0.1-stdstringfromnull.patch.1 \
))
# vim: set noet sw=4 ts=4:

View File

@ -0,0 +1,11 @@
--- a/src/lib/ABWContentCollector.cpp
+++ b/src/lib/ABWContentCollector.cpp
@@ -643,7 +643,7 @@ void libabw::ABWContentCollector::collectHeaderFooter(const char *id, const char
if (!type)
m_ps->m_currentHeaderFooterId = -1;
- std::string sType(type);
+ std::string sType(type ? type : "");
boost::trim(sType);
std::vector<std::string> strVec;
boost::algorithm::split(strVec, sType, boost::is_any_of("-"), boost::token_compress_on);