C11 specifies memchr() as follows:
The memchr function locates the first occurrence of c (converted to an unsigned
char) in the initial n characters (each interpreted as unsigned char ) of the object
pointed to by s. The implementation shall behave as if it reads the characters sequentially
and stops as soon as a matching character is found.
In particular, it is well-defined to specify a memchr size larger than the underlying object, as long as the character is found before the end of the object.