Add checks for non-null-terminated strings.

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