ruiu added a comment. One thing we could do to prevent buffer overrun is to check if a string table ends with '\0'. String table is runs of null-terminated, so it should ends with null, and that should work as the last stopper. https://reviews.llvm.org/D27037