Repository navigation
fix(elements): accept legacy alias paths without trailing null terminator - #52
Merged
hutcheb merged 1 commit intoNov 3, 2026
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
_legacy_alias_forrejects a legacy alias path with no trailing null terminatorSymptom
aborting the entire export, for a tag whose alias path is well-formed UTF-16
but simply isn't null-terminated.
Root cause
This assumes a legacy alias path is always terminated with a trailing
b"\x00\x00"UTF-16 code unit. On a real project file, one was found thatis not:
40006100360064003800300065006600630040002e00decodes as@a6d80efc@.— a resolved-later object-id placeholder followed by aliteral
.with no terminator at all, presumably because the path endsin a
.<member/bit>reference (a bit or array/structure member) thatoccupies the field's full stored length with nothing left over for a
terminator.
Fix
Only require the length to be a whole number of UTF-16 code units
(
len(value) % 2 == 0); a missing terminator isn't itself invalid. Theexisting
.rstrip("\x00")on the next line already handles theterminator's presence correctly, so nothing else needs to change.
Suggested validation
Any legacy alias path ending in a
.<member>or.<bit>reference thathappens to consume the field's entire stored length (no trailing null) is
the shape to check for; the fix accepts it while continuing to reject an
odd-length (non-whole-UTF-16) value as before.
🤖 Generated with Claude Code