cppcheck/cli
Pino Toscano 0a50d8e8f4
FileLister: ensure enough space for resulting dirent (#2850)
On some platforms, the 'd_name' field of struct dirent is not a static
fixed-sized array but a "flexarray" (i.e. a single character); in this
situation, 'd_name' points to a buffer allocated somewhere, usually
at the end of the buffer used for dirent (which is then allocated in a
bigger memory). Because of this, creating a struct dirent on stack as
buffer for readdir_r is not enough to store all the memory needed for
a dirent on those platforms.

As result, create an helper union with all the needed space, calculated
statically at build time. NAME_MAX+1 is still not a perfect option, but
it will do the job in the vast majority of cases.
2020-10-18 20:43:33 +02:00
..
CMakeLists.txt
cli.vcxproj
cli.vcxproj.filters
cmdlineparser.cpp
cmdlineparser.h
cppcheckexecutor.cpp
cppcheckexecutor.h
filelister.cpp FileLister: ensure enough space for resulting dirent (#2850) 2020-10-18 20:43:33 +02:00
filelister.h
main.cpp
threadexecutor.cpp
threadexecutor.h
version.rc