Steps to reproduce: 1. Load: data:text/html;charset=utf-16,%41 Result: ###!!! ASSERTION: Too few bytes in input: '*aSrcLength >= 2', file /Users/jruderman/trunk/mozilla/intl/uconv/ucvlatin/nsUCS2BEToUnicode.cpp, line 229 It looks like nsUTF16ToUnicode::Convert then proceeds to read past the end of the string while trying to determine its endianness. I don't know whether this is a bug in nsUTF16ToUnicode::Convert or a bug in the caller.
nsUTF16ToUnicode::Convert, I think. Callers of converters shouldn't need to know about the byte structure of encodings.
Created attachment 298097 [details] [diff] [review] Patch I'm in two minds whether the Right Thing To Do here is to fail silently or return an error code, but I think the error code is preferable.
Is this ready for checkin? If so, please nominate for approval1.9?
Does this need approval? It was marked as blocking 1.9 and I could have checked it in before but since the change is so small I was waiting to check it in together with bug 317126 when that got reviewed.
er, bug 317216
Checked in to trunk, with unit test
Checked in to 1.8 branch (with bug 317216)