48b3d5c6b1
CodeQL re-opened the unvalidated-pointer-arithmetic alert at the new textEnd line because Encoding.GetBytes is a virtual method on Encoding and the returned array's Length is therefore tracked as untrusted input for pointer arithmetic. Compute the expected byte count from the same encoder via GetByteCount and bail out if the actual buffer length does not match. That is a real consistency check that would catch a maliciously swapped Encoding.UTF8 instance, not a dead defensive guard. The empty-split early-out from the previous fix is folded into the same condition.