summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-06-23 17:06:42 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-06-23 17:06:42 +0000
commit34cbe3277346550d1b475e8f9cc632e0a0fe0721 (patch)
treeaf91170d281c6eb674ef67861501e22c20722e77 /src
parent2da75b0f1835a260859801ef2446ec2e12e4c543 (diff)
Added null pointer assertions to as_utf8 and as_wide
git-svn-id: http://pugixml.googlecode.com/svn/trunk@531 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'src')
-rw-r--r--src/pugixml.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp
index c17047c..e6b24e2 100644
--- a/src/pugixml.cpp
+++ b/src/pugixml.cpp
@@ -4459,6 +4459,8 @@ namespace pugi
#ifndef PUGIXML_NO_STL
std::string PUGIXML_FUNCTION as_utf8(const wchar_t* str)
{
+ assert(str);
+
STATIC_ASSERT(sizeof(wchar_t) == 2 || sizeof(wchar_t) == 4);
size_t length = wcslen(str);
@@ -4495,6 +4497,8 @@ namespace pugi
std::wstring PUGIXML_FUNCTION as_wide(const char* str)
{
+ assert(str);
+
const uint8_t* data = reinterpret_cast<const uint8_t*>(str);
size_t size = strlen(str);