You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The ptr member of GL3WProcs appears to be off-by-one member smaller than it should be to hold all the loaded function pointers from proc_names.
staticvoidload_procs(GL3WGetProcAddressProc proc)
{
size_t i;
for (i = 0; i < ARRAY_SIZE(proc_names); i++) // ARRAY_SIZE(proc_names) == 54
imgl3wProcs.ptr[i] = proc(proc_names[i]); // ARRAY_SIZE(imgl3wProcs.ptr) == 53, results in buffer overrun
}
proc_names is 54 elements in length, and ptr is 53 elements in length, resulting in a buffer overrun + error reported in ubsan:
vendor/imgui/backends/imgui_impl_opengl3_loader.h:751:9: runtime error: index 53 out of bounds for type 'GL3WglProc [53]'
SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior ./vendor/imgui/backends/imgui_impl_opengl3_loader.h:751:9 in
I figure this is a bug in https://github.com/dearimgui/gl3w_stripped/blob/gl3w_stripped/gl3w_gen.py somewhere, but I was unable to reproduce the issue (I'm not sure what ./extra_symbols.txt were used for the file checked into Dear ImGui). When I do generate my own gl3w header, it ends up with 659 members in it, and the ptr member is 659 elements in size, which seems right.
The text was updated successfully, but these errors were encountered:
My bad for 389982e we probably mismerged something manually.
Fixed with 89a2820 now, will add an assert in that function to avoid that happening in the future.
Thank you!
Dear ImGui Config/Build information:
The
ptr
member ofGL3WProcs
appears to be off-by-one member smaller than it should be to hold all the loaded function pointers fromproc_names
.proc_names is 54 elements in length, and ptr is 53 elements in length, resulting in a buffer overrun + error reported in ubsan:
I figure this is a bug in https://github.com/dearimgui/gl3w_stripped/blob/gl3w_stripped/gl3w_gen.py somewhere, but I was unable to reproduce the issue (I'm not sure what
./extra_symbols.txt
were used for the file checked into Dear ImGui). When I do generate my own gl3w header, it ends up with 659 members in it, and the ptr member is 659 elements in size, which seems right.The text was updated successfully, but these errors were encountered: