amorlzu / pugixml

Automatically exported from code.google.com/p/pugixml
0 stars 0 forks source link

got null deferences 4 logic errors #188

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

using LLVM 4

What is the expected output? What do you see instead?

Code fixed for uncertain behaviors

Which version of pugixml are you using? On what operating system/compiler?

version 1.2

Please provide any additional information below.

struct xml_allocator

xml_memory_page* page = xml_memory_page::construct(page_memory); initialized to 
a null pointer

PUGI__FN bool strcpy_insitu(char_t*& dest, uintptr_t& header, uintptr_t 
header_mask, const char_t* source)
xml_allocator* alloc = reinterpret_cast<xml_memory_page*>(header & 
xml_memory_page_pointer_mask)->allocator; deference of null pointer

PUGI__FN void xml_document::create()
page->busy_size = impl::xml_memory_page_size;

const char_t* alloc_string(const xpath_lexer_string& value)
memcpy(c, value.begin, length * sizeof(char_t)); null argument c 

Original issue reported on code.google.com by 0xcafef...@gmail.com on 3 Dec 2012 at 7:55

GoogleCodeExporter commented 9 years ago
Not sure what LLVM 4 is. Please provide a full version of the used compiler 
with the compiler switches. Please also provide a complete log.
From the available information it looks like all presented lines are false 
positives.

Original comment by arseny.k...@gmail.com on 4 Dec 2012 at 1:48

GoogleCodeExporter commented 9 years ago
llvm-gcc-4.2 (clang) 

http://clang.llvm.org/

Original comment by 0xcafef...@gmail.com on 4 Dec 2012 at 2:09

GoogleCodeExporter commented 9 years ago
All of these are false positives; however, it's easy to work around them.
Will be fixed in trunk soon.

Original comment by arseny.k...@gmail.com on 6 Dec 2012 at 8:01

GoogleCodeExporter commented 9 years ago
Fixed in trunk.

Original comment by arseny.k...@gmail.com on 8 Dec 2012 at 4:06

GoogleCodeExporter commented 9 years ago
ok thx, indeed I had already fixed that in my tree as I am using your API as a 
private type of serialization of my smalltalk like object hierarchy, if I may, 
I woud have one more tiny request: rename foreach.hpp to pugiforeach.hpp and 
include the header anyway with a guard "ifdef BOOST", much appreciate your 
reactivity.

Original comment by 0xcafef...@gmail.com on 8 Dec 2012 at 8:14