Displaying 2 results from an estimated 2 matches for "getlegalmapsize".
2016 Nov 17
3
UB in MemoryBufferMMapFile
...this with
`BufEnd = Start + Len`:
from lib/Support/MemoryBuffer.cpp:210:
> MemoryBufferMMapFile(bool RequiresNullTerminator, int FD, uint64_t Len,
> uint64_t Offset, std::error_code &EC)
> : MFR(FD, sys::fs::mapped_file_region::readonly,
> getLegalMapSize(Len, Offset), getLegalMapOffset(Offset), EC) {
> if (!EC) {
> const char *Start = getStart(Len, Offset);
> init(Start, Start + Len, RequiresNullTerminator);
> }
> }
This is UB, since we're reading one past an allocated region, and I have
an internal test ca...
2016 Nov 17
2
UB in MemoryBufferMMapFile
...t;> from lib/Support/MemoryBuffer.cpp:210:
>>> MemoryBufferMMapFile(bool RequiresNullTerminator, int FD, uint64_t Len,
>>> uint64_t Offset, std::error_code &EC)
>>> : MFR(FD, sys::fs::mapped_file_region::readonly,
>>> getLegalMapSize(Len, Offset), getLegalMapOffset(Offset), EC) {
>>> if (!EC) {
>>> const char *Start = getStart(Len, Offset);
>>> init(Start, Start + Len, RequiresNullTerminator);
>>> }
>>> }
>>
>> This is UB, since we're reading one pas...