Skip to content

Commit

Permalink
Buffer over-read with ArrayNullabilityMode.PerInstance (#5675)
Browse files Browse the repository at this point in the history
Fixes #5674
  • Loading branch information
John-Paul-R authored and NinoFloris committed Apr 21, 2024
1 parent 58b9a1b commit 5fd00dd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/Npgsql/Internal/Converters/ArrayConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,12 @@ public PolymorphicArrayConverter(PgConverter<TBase> structElementCollectionConve
_nullableElementCollectionConverter = nullableElementCollectionConverter;
}

public override bool CanConvert(DataFormat format, out BufferRequirements bufferRequirements)
{
bufferRequirements = BufferRequirements.Create(read: sizeof(int) + sizeof(int), write: Size.Unknown);
return format is DataFormat.Binary;
}

public override TBase Read(PgReader reader)
{
_ = reader.ReadInt32();
Expand Down

0 comments on commit 5fd00dd

Please sign in to comment.