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 easiest way to observe this is to compile with libstdc++ assertions enabled. In Makefile.linux, add -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS to the CPPFLAGS. (This is part of the distribution default compiler flags in Fedora).
musicinmybrain
changed the title
The OFF import routine for cffconv can access out of bounds
The OFF import routine for ctmconv can access out of bounds
Apr 9, 2024
The easiest way to observe this is to compile with libstdc++ assertions enabled. In
Makefile.linux
, add-Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3 -Wp,-D_GLIBCXX_ASSERTIONS
to theCPPFLAGS
. (This is part of the distribution default compiler flags in Fedora).Now,
If we remove
-s
so the executable is not stripped of debug symbols:OpenCTM/tools/Makefile.linux
Line 56 in 91b3b71
…and furthermore add
-g -Og
to theCPPFLAGS
, then recompile, then we can try again with gdb and get a really nice backtrace:We can see that when
TrimString
is passed an empty string,p2
wraps around to the largestsize_t
value…OpenCTM/tools/common.cpp
Lines 42 to 45 in 91b3b71
…and the following loop accesses many bytes from the string…
OpenCTM/tools/common.cpp
Lines 46 to 47 in 91b3b71
…which is of course very bad, because the string is empty.
The text was updated successfully, but these errors were encountered: