Skip to content

Conversation

John-Paul-R
Copy link
Contributor

@John-Paul-R John-Paul-R commented Apr 17, 2024

CanConvert was not overridden for PolymorphicArrayConverter<T>, but 8 bytes but be read-ahead in order to populate containsNulls in Read/ReadAsync.

Resolves #5674

`CanConvert` was not overridden for `PolymorphicArrayConverter<T>`, but 8 bytes but be read-ahead in order to populate `containsNulls` in `Read`/`ReadAsync`.
@John-Paul-R
Copy link
Contributor Author

I'm not certain what the appropriate steps are, but this seems like the type of thing that should be patched for existing versions (I know for certain it affects Npgsql 8.0.2). Let me know if I need to take any action to backport the fix.

@roji roji requested a review from NinoFloris April 21, 2024 21:22
@NinoFloris
Copy link
Member

@John-Paul-R thanks for finding and fixing this issue.

I've slightly improved the requirements as they are only correct for reads but beyond that, LGTM!

I will also backport this to 8.0.3.

@NinoFloris NinoFloris merged commit 9e70a62 into npgsql:main Apr 21, 2024
@NinoFloris
Copy link
Member

Backported to 8.0.3 via 5fd00dd

@John-Paul-R
Copy link
Contributor Author

Great, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential buffer over-read (yielding exception) when reading arrays with ArrayNullabilityMode.PerInstance
2 participants