[I18N] Assertions to prevent a buffer overrun.

The overrun bug (#9578) is still there, but at least now it's not triggered.