Skip to content

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

@Bikemech

Description

@Bikemech

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

Metadata

Metadata

Assignees

Labels

prio:lowLow prioritystatus:doneTask completed successfullytype:fixSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions