Skip to content

Fix unnecessary repetitions in the crowd - #686

Open
ikpil wants to merge 1 commit into
recastnavigation:mainfrom
ikpil:pr/avoid-unnecessary-repetitions
Open

Fix unnecessary repetitions in the crowd#686
ikpil wants to merge 1 commit into
recastnavigation:mainfrom
ikpil:pr/avoid-unnecessary-repetitions

Conversation

@ikpil

@ikpil ikpil commented Jan 23, 2024

Copy link
Copy Markdown

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

// Item not found, add it.
if (i == end)
{
ids[n++] = item.id;

Copy link
Copy Markdown
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