protected boolean editAllowed(Address addr, long length) {
		Listing listing = program.getListing();
		Address a = addr;
		for (int i = 0; i < length; i++) {
			try {
				a = a.addNoWrap(i);
			}
			catch (AddressOverflowException e) {
				return false;
			}
			CodeUnit cu = listing.getCodeUnitContaining(a);
			if (cu instanceof Data) {
				continue;
			}
			return false;
		}
		return true;
	}
Return true if undefined data exists at the given address; return false if code unit exists,
thus editing is not allowed.
Ghidra/Features/ByteViewer/src/main/java/ghidra/app/plugin/core/byteviewer/MemoryByteBlock.java