As Rich Lowe pointed out in Bug 52371, the Solaris version of MemoryMappingLayout::Next completely failed to handle readlink errors or properly
NUL-terminate the result.
This patch fixes this. Originally provided in the PR with slight formatting changes.
Tested on amd64-pc-solaris2.11.
I'm uncertain how to properly attribute the patch on commit, though.
Can you check if sanitizer_common/tests/sanitizer_procmaps_test.cc can be enabled for Solaris and does it trigger this error?