Page MenuHomePhabricator

[XRay] [compiler-rt] fix heap overflow by computing record pointers correctly

Authored by pelikan on Jan 19 2018, 3:19 AM.



While there, unify InMemoryRawLog and InMemoryRawLogWithArg's coding style:

  • swap libc's memcpy(3) for sanitizer's internal memcpy
  • use basic pointer arithmetics to compute offsets from the first record entry in the pre-allocated buffer, which is always the appropriate type for the given function
  • lose the local variable references as the TLD.* names fit just as well

Diff Detail


Event Timeline

pelikan created this revision.Jan 19 2018, 3:19 AM
Herald added a subscriber: Restricted Project. · View Herald TranscriptJan 19 2018, 3:19 AM
dberris accepted this revision.Jan 19 2018, 4:55 AM

Good catch, thanks!

This revision is now accepted and ready to land.Jan 19 2018, 4:55 AM
This revision was automatically updated to reflect the committed changes.