Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling SetupAxisTicks with a single label will cause strlen to be called on undefined memory #600

Open
Bikemech opened this issue Nov 20, 2024 · 0 comments

Comments

@Bikemech
Copy link

Using ImPlot v0.17 on Windows 10

When SetupAxisTicks with the parameter n_ticks = k and k entries into the parameters labels, all the labels will be iterated over and passed into strlen.

However when SetupAxisTicks is called with and the parameter n_ticks = 1 and only single entry in the parameter labels is provided the function will set n_ticks to 2 but not make any corrections or checks on the amount of label entries causing an undefined region of the memory to be passed into strlen when labels are iterated over.

I do realize that this is an edge case and it might not be possible to make a neat fix since the functions deals with raw pointers but seeing action is taken to make sure a valid n_ticks is passed some I would expect some checking on the labels pointer as well.

Best

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

No branches or pull requests

1 participant