munge_extrainfo_into_routerinfo would mishandle a non-extrainfo
If you could somehow make munge_extrainfo_into_routerinfo() get a document which wasn't an extrainfo, it would be in trouble, since it assumes that the relevant history lines are NUL-terminated.
For quality-of-implementation, it should check the return value of memchr().