Avoid UB decoding LEB128, and guard against corrupted files
read_leb_128_detail accumulated decoded bytes into a signed IntType. For int32 values, a 5-byte LEB128 encoding reaches shift 28, which causes signed-integer-overflow UB. Accumulate into u32 instead and cast to IntType only after sign extension.
Also harden the network reader against short or corrupted files: read_leb_128_detail now tracks the number of bytes actually read and fails the stream on a short read; read_header bounds the description string by the stream rather than a declared size; and the LEB128 magic and byte-balance checks are promoted from asserts to stream failures.
closes https://github.com/official-stockfish/Stockfish/pull/7066
No functional change
Co-authored-by: ppigazzini <pasquale.pigazzini@gmail.com>