Add checks for non-null-terminated strings.

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