private int getNullTerminatorOffset(byte[] bytes, int numBytes) {
		for (int i = 0; i < numBytes; i++) {
			if (bytes[i] == 0) {
				return i; // Found the null terminator.
			}
			if (!isValidAsciiByte(bytes[i])) {
				return -1;
			}
		}
		return -1;
	}
getStringLength determines the length of the null terminated ASCII
string beginning at the indicated address in memory.
The length of the string includes the null terminator character
and any additional bytes to make it the correct alignment length for
this processor.
This method returns -1 if it encounters invalid characters before
reaching the null terminator.
It also returns -1 if the number of characters before the null is less
than the current minimum string length obtained from the analysis options.
@param memory the program memory for obtaining the strings bytes
@param startAddress = address where string is believed to begin
@param stringAlignment the alignment size for the string
@return length of proposed string, -1 if not string.
Note: The length of the string includes the null terminator character
and any additional bytes to make it the correct alignment length for
this processor.

For analyzing null-terminated strings.  If a non-printable
character occurs before a null byte, it is not a string and
-1 is returned.  Also if 1000 chars have gone by without
a null, then again -1 is returned.
Ghidra/Features/Base/src/main/java/ghidra/app/plugin/core/analysis/OperandReferenceAnalyzer.java