|
From: Ethan M. <merritt@u.washington.edu> - 2006-10-17 19:54:53
|
Bernhard Simon has reported a problem with "make check" run under an older version of AIX. The stringvar demo caused a segfault. He obligingly traced it to a buffer overflow from a code path using sprintf, which we use only if the system does not provide snprintf. We handle the test case correctly if snprintf is present. This is a general problem, and is mentioned in our TODO file but not in the README or INSTALL files. Simple test =========== manually edit config.h to #undef HAVE_SNPRINTF build gnuplot run test input set format xy "%4096g" plot x With snprintf: util.c:595: Warning: too many digits for format Without snprintf: *** glibc detected *** realloc(): invalid next size: 0x085c64c8 *** Abort or (different test machine): segfault Question ======== Should we have ./configure print out a warning if snprintf is not found? WARNING: Could not find a working snprintf() function. Buffer overflows and segfaults may be triggered by overlong format specifiers provided to gnuplot by the user. Please consider providing snprintf via an external library. Should we issue the same warning at build time? Run time? -- Ethan A Merritt Biomolecular Structure Center University of Washington, Seattle WA |