[profile] hoist length check before use of pointer (#217109)

If a truncated profile is passed into this endpoint (say, 1 byte), we
unconditionally do `((__llvm_profile_header
*)ProfileData)->BinaryIdsSize`, which reaches outside of the `char`
array passed to this function.

Hoisting the check prevents the out-of-bounds read.

GitOrigin-RevId: 9932f190f42e1a12c3cafea23938241abf6337ca
1 file changed