I think I found a bug in GNU sed: The "." regular expression doesn't
match null bytes.
This is mandated by POSIX.
No, POSIX says that the input to sed must be a text file, and that
null bytes are not allowed in text files. So if the input contains a
null byte, GNU 'sed' can do whatever it likes. It will still conform
to POSIX even if "." matches a NUL byte.
In both GNU grep and GNU Emacs, "." matches a NUL byte, and there is a
strong argument that GNU "sed" should be consistent with other GNU
tools in this area.