|author||Vlad Tsyrklevich <firstname.lastname@example.org>||Wed Dec 19 20:41:20 2018|
|committer||Commit Bot <email@example.com>||Wed Dec 19 21:42:23 2018|
Change edge case handling in ReadCStringInternal Currently, TaskMemory::ReadCStringInternal() treats the ReadCStringSizeLimited(size=0) case by returning an empty string; however, that is inconsistent with the documentation for that function and the equivalent implementation in ProcessMemory. The comment for the size parameter is: "The maximum number of bytes to read. The string is required to be `NUL`-terminated within this many bytes." My interpretation is that the ProcessMemory behavior is correct in failing on size=0 as a NUL can never be read. ReadCStringSizeLimited() is only used with a possibly null size in MachOImageReader::ReadDylinkerCommand(). In that case we read the dylinker_command string, which appears to also be verified to be a non-zero length null terminated string in load_dylinker() in bsd/kern/mach_loader.c so we shouldn't hit this case in the wild. Bug: crashpad:263 Change-Id: I2bd9c0ce3055154a98afdd19af95bb48d05f05a3 Reviewed-on: https://chromium-review.googlesource.com/c/1384448 Reviewed-by: Mark Mentovai <firstname.lastname@example.org> Commit-Queue: Vlad Tsyrklevich <email@example.com>
Crashpad is a crash-reporting system.
Crashpad’s source code is hosted in a Git repository at https://chromium.googlesource.com/crashpad/crashpad.