Skip to content

Conversation

@TorsteinTenstadNorsonic
Copy link
Contributor

There seems to be a bug in Verifyer::VerifyUnion: The offset of the union type is extracted and checked, but overwritten by the offset of the value before reading out the typeId of the union, leading to the typeId being incorrect.

In the typical case, the offset of the value is larger than the largest typeId in the union, leaving the verifier to assume that the union is from a future schema version. This means that the union value is never verified.

The first commit in this PR adds a unit test that fails due to this bug.
The second commit fixes the bug.

@github-actions github-actions bot added the c# label May 5, 2025
@bjornharrtell bjornharrtell self-requested a review August 24, 2025 15:14
Copy link
Collaborator

@bjornharrtell bjornharrtell left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR and motivation for this seems sensible but I know too little about the verifier to be entirely sure about it's correctness. @aardappel does it seem right to do this fix?

Copy link
Collaborator

@aardappel aardappel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup this makes sense to me, thanks!

@aardappel aardappel merged commit 35230bd into google:master Aug 28, 2025
49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants