2118943 ] out_of_bound access in Poco::Data::BLOB:rawContent

This commit is contained in:
Guenter Obiltschnig
2008-09-19 08:33:19 +00:00
parent 3a1715de5b
commit 0be3772812

View File

@@ -98,6 +98,8 @@ public:
const char* rawContent() const;
/// Returns the raw content.
///
/// If the BLOB is empty, returns NULL.
void assignRaw(const char* pChar, std::size_t count);
/// Assigns raw content to internal storage.
@@ -136,8 +138,10 @@ inline const std::vector<char>& BLOB::content() const
inline const char* BLOB::rawContent() const
{
poco_assert (_pContent->size());
return &(*_pContent)[0];
if (_pContent->empty())
return 0;
else
return &(*_pContent)[0];
}