diff options
author | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-03-05 10:18:47 -0800 |
---|---|---|
committer | Arseny Kapoulkine <arseny.kapoulkine@gmail.com> | 2015-03-05 10:19:28 -0800 |
commit | 57ca94f89722937e8eb33537b0f290928d92bb7d (patch) | |
tree | 98b4cf45d5cb73e0679bc9fd7939fd933391530b /src/pugixml.cpp | |
parent | 5a848de085e8f2b0458ee7afba5a3d95572f11c2 (diff) | |
parent | 7ae73442560a50261fe88c5fd5aeceabef9d6b78 (diff) |
load_buffer_impl now checks that buffer is valid
Merge branch 'mloy-master'
Diffstat (limited to 'src/pugixml.cpp')
-rw-r--r-- | src/pugixml.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/pugixml.cpp b/src/pugixml.cpp index d8a6888..787f693 100644 --- a/src/pugixml.cpp +++ b/src/pugixml.cpp @@ -4316,7 +4316,12 @@ PUGI__NS_BEGIN PUGI__FN xml_parse_result load_buffer_impl(xml_document_struct* doc, xml_node_struct* root, void* contents, size_t size, unsigned int options, xml_encoding encoding, bool is_mutable, bool own, char_t** out_buffer) { // check input buffer - assert(contents || size == 0); + if ((contents==NULL) && (size!=0)) { + xml_parse_result result; + result.status = status_no_document_element; + return result; + } + // get actual encoding xml_encoding buffer_encoding = impl::get_buffer_encoding(encoding, contents, size); |