Immediate-Mode-UI / Nuklear

A single-header ANSI C immediate mode cross-platform GUI library
https://immediate-mode-ui.github.io/Nuklear/doc/index.html
Other
9.06k stars 542 forks source link

UBSan trip in GLFW+OGL3 Backend #516

Closed Th3T3chn0G1t closed 1 year ago

Th3T3chn0G1t commented 1 year ago

When using the GLFW+OGL3 demo backend with UBSan tooling, nk_glfw3_render leads to the following message:

nuklear_glfw_gl3.h:297:20: runtime error: applying non-zero offset 240 to null pointer
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior nuklear_glfw_gl3.h:297:20

The line in question is here - which makes me think that the loop condition relies on a pseudo OOB? Screenshot 2022-11-22 at 21 44 13

This probably doesn't pose much of an actual functionality worry, but it's kind of annoying when libs can cause trips as then suppressions are needed etc.

If this could be fixed it would be swell, thanks!

dumblob commented 1 year ago

Sure, thanks for pointing it out. Could you make a PR? Thanks!