Just after pushing the fix for that heap-clobbering bug, http://debbugs.gnu.org/22127, I noticed there was another minor problem: sed would silently elide any invalid byte specified in a substitution replacement string. Here's a patch that's not quite complete (no NEWS entry, and I haven't yet tried to determine when it was introduced).