Skip to content

Buffer overflow in ExpressionHasher.Append(char a, char b) #8774

@tomachristian

Description

@tomachristian

Product

Hot Chocolate

Version

15.1.10

Link to minimal reproduction

Steps to reproduce

I'm not doing anything fancy, just trying to filter by the Name (string) of an entity.

Image

Getting:

"message": "Index was outside the bounds of the array.",
        "stackTrace": "   at GreenDonut.Data.Internal.ExpressionHasher.Append(Char a, Char b)\r\n   at GreenDonut.Data.Internal.ExpressionHasher.Add[T](SortDefinition`1 sortDefinition)\r\n
Image

The check on line 276 is incorrect, it should be if (_start + 1 >= _buffer.Length) I guess.

What is expected?

Filtering should work

What is actually happening?

"message": "Index was outside the bounds of the array.",
        "stackTrace": "   at GreenDonut.Data.Internal.ExpressionHasher.Append(Char a, Char b)\r\n   at GreenDonut.Data.Internal.ExpressionHasher.Add[T](SortDefinition`1 sortDefinition)\r\n

Relevant log output

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions