diff --git a/include/boost/dll/detail/pe_info.hpp b/include/boost/dll/detail/pe_info.hpp index 7f1584a..341a123 100644 --- a/include/boost/dll/detail/pe_info.hpp +++ b/include/boost/dll/detail/pe_info.hpp @@ -320,8 +320,10 @@ class pe_info: public x_info_interface { section_end_addr = section_begin_addr + image_section_header.SizeOfRawData; } } - BOOST_ASSERT(section_begin_addr); - BOOST_ASSERT(section_end_addr); + + // returning empty result if section was not found + if(section_begin_addr == 0 || section_end_addr == 0) + return ret; } const exports_t exprt = exports(h); diff --git a/test/library_info_test.cpp b/test/library_info_test.cpp index bce2581..113f6ee 100644 --- a/test/library_info_test.cpp +++ b/test/library_info_test.cpp @@ -44,6 +44,8 @@ int main(int argc, char* argv[]) BOOST_TEST(std::find(symb.begin(), symb.end(), "say_hello") == symb.end()); BOOST_TEST(lib_info.symbols(std::string("boostdll")) == symb); + std::vector empty = lib_info.symbols("empty"); + BOOST_TEST(empty.empty() == true); // Self testing std::cout << "Self: " << argv[0];