Add checks for non-null-terminated strings.

Change-Id: I737fe384c15bf5b07d8b1f91f1fb3447ec144fb8
Reviewed-on: https://code.wireshark.org/review/5661
Reviewed-by: Guy Harris <guy@alum.mit.edu>