I considered adding the strnlen module to Emacs, but this had the problem of bringing in the memchr module, which is pretty heavyweight. I propose that we remove this dependency, as the bugs fixed by the memchr module are not tickled by the gnulib strnlen implementation.
Possibly other dependencies on memchr could be removed too, but I haven't checked for this.