Provide consistent behaviour for memchr(_,_,0)
A memchr() search of a zero-byte range returns an undefined value. On arm32 it always returns NULL, but on arm64 it does not. This causes random crashes while reading /proc/self/maps when loading the 64-bit libchrome. Fix by setting the value to which memchr() assigns to NULL if the search range is zero bytes. There are three calls to memchr(). Two of them could encounter this; the third is safe. BUG=394306 Review URL: https://codereview.chromium.org/405153002 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@284693 0039d316-1c4b-4281-b951-d872f2087c98
Showing
Please register or sign in to comment