Skip to content

Conversation

ikpil
Copy link

@ikpil ikpil commented Jan 23, 2024

Maximum values should be checked after post-processing, as unnecessary repetitions may occur.

@@ -163,9 +163,9 @@ int dtProximityGrid::queryItems(const float minx, const float miny,
// Item not found, add it.
if (i == end)
{
ids[n++] = item.id;
Copy link
Contributor

Choose a reason for hiding this comment

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

If maxIds is initially 0 and ids has 0 size (i.e. points to invalid memory) or nullptr this will lead to a crash due to nullptr dereference or out of bounds access.

@ikpil ikpil force-pushed the pr/avoid-unnecessary-repetitions branch 2 times, most recently from af2d04e to 8f8cc01 Compare January 29, 2024 16:38
@ikpil ikpil force-pushed the pr/avoid-unnecessary-repetitions branch from 5376ca0 to 83e779e Compare April 16, 2024 14:05
@ikpil ikpil force-pushed the pr/avoid-unnecessary-repetitions branch from 83e779e to b834ca3 Compare May 27, 2024 15:08
Maximum values should be checked after post-processing, as unnecessary repetitions may occur.
@ikpil ikpil force-pushed the pr/avoid-unnecessary-repetitions branch from b834ca3 to bfc88ea Compare May 27, 2024 15:09
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.

2 participants