Displaying 2 results from an estimated 2 matches for "requiresnullterminator".
2016 Nov 17
3
UB in MemoryBufferMMapFile
In MemoryBuffer::init, we have an assert that reads the memory at
`BufEnd`, which is one past the end of some memory region:
from lib/Support/MemoryBuffer.cpp:45:
> void MemoryBuffer::init(const char *BufStart, const char *BufEnd,
> bool RequiresNullTerminator) {
> assert((!RequiresNullTerminator || BufEnd[0] == 0) &&
> "Buffer is not null terminated!");
> BufferStart = BufStart;
> BufferEnd = BufEnd;
> }
However, this can be, and often is, one past an allocated region, since
in MemoryBufferMMapFile we mma...
2016 Nov 17
2
UB in MemoryBufferMMapFile
...ffer::init, we have an assert that reads the memory at
>> `BufEnd`, which is one past the end of some memory region:
>>
>> from lib/Support/MemoryBuffer.cpp:45:
>>> void MemoryBuffer::init(const char *BufStart, const char *BufEnd,
>>> bool RequiresNullTerminator) {
>>> assert((!RequiresNullTerminator || BufEnd[0] == 0) &&
>>> "Buffer is not null terminated!");
>>> BufferStart = BufStart;
>>> BufferEnd = BufEnd;
>>> }
>
> Commenting from a historical perspective, this is as inte...