Paul Eggert <egg...@cs.ucla.edu> writes: > On 6/26/24 12:33, Paul Eggert wrote: >> I installed the attached patch to document the Android 5.0 glitch > > Oops, attached the wrong patch. Here's the patch I meant to attach.
Btw, doesn't this also mean that lib/strnlen.c (in Emacs, at least) is incorrect? size_t strnlen (const char *string, size_t maxlen) { const char *end = memchr (string, '\0', maxlen); return end ? (size_t) (end - string) : maxlen; } is virtually identical to Android's implementation and equally liable to overflow in memchr with excessive falues of MAXLEN.