You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@fory.apache.org by GitBox <gi...@apache.org> on 2026/02/05 13:08:48 UTC
[GH] (fory/fix/go-utf16le-odd-bytecount): Workflow run "Fory CI" is working again!
The GitHub Actions job "Fory CI" on fory.git/fix/go-utf16le-odd-bytecount has succeeded.
Run started by GitHub user jonyoder (triggered by jonyoder).
Head commit for run:
6fff8adaf3f56c09fa6eed4f422c077c6ebf038d / Jonathan Yoder <jo...@posit.co>
fix(go): prevent panic in readUTF16LE with odd byte counts
When readUTF16LE receives an odd byte count (which indicates malformed
UTF-16 data), the function would panic with "index out of range" because
the loop iterated up to byteCount but tried to access data[i+1] on the
last iteration.
This fix rounds down to the nearest even byte boundary before iterating,
gracefully handling malformed data by ignoring the trailing byte instead
of panicking.
Fixes the panic:
runtime error: index out of range [N] with length N
Added test cases:
- TestReadUTF16LE_OddByteCount: verifies no panic with odd byte count
- TestReadUTF16LE_SingleByte: verifies empty string for single byte
- TestReadUTF16LE_EvenByteCount: verifies normal case still works
- TestReadUTF16LE_EmptyBuffer: verifies empty input handling
- TestReadUTF16LE_SurrogatePair: verifies emoji/surrogate pair decoding
Co-Authored-By: Claude Opus 4.5 <no...@anthropic.com>
Report URL: https://github.com/apache/fory/actions/runs/21712527001
With regards,
GitHub Actions via GitBox
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@fory.apache.org
For additional commands, e-mail: commits-help@fory.apache.org