Code::Blocks Forums

Developer forums (C::B DEVELOPMENT STRICTLY!) => Development => Topic started by: TheTuxKeeper on January 12, 2009, 01:45:13 pm

Title: Buffer overflow warning/error in SqPlus.cpp
Post by: TheTuxKeeper on January 12, 2009, 01:45:13 pm
Hi,

that's the warning I get when compiling src/sdk/scripting/sqplus/SqPlus.cpp with gcc 4.3. It's rev5382.
Code
In function 'int snprintf(char*, size_t, const char*, ...)',
    inlined from 'SQInteger SqPlus::getVar(StackHandler&, SqPlus::VarRef*, void*)' at SqPlus.cpp:178:
/usr/include/bits/stdio2.h:66: warning: call to int __builtin___snprintf_chk(char*, unsigned int, int, unsigned int, const char*, ...) will always overflow destination buffer
In function 'int snprintf(char*, size_t, const char*, ...)',
    inlined from 'SQInteger SqPlus::setVar(StackHandler&, SqPlus::VarRef*, void*)' at SqPlus.cpp:67:
/usr/include/bits/stdio2.h:66: warning: call to int __builtin___snprintf_chk(char*, unsigned int, int, unsigned int, const char*, ...) will always overflow destination buffer
In function 'int snprintf(char*, size_t, const char*, ...)',
    inlined from 'SQInteger SqPlus::setVar(StackHandler&, SqPlus::VarRef*, void*)' at SqPlus.cpp:117:
/usr/include/bits/stdio2.h:66: warning: call to int __builtin___snpri ntf_chk(char*, unsigned int, int, unsigned int, const char*, ...) will always overflow destination buffer
Because of this the package doesn't get published for suse 11.1 in my repository on the buildservice (a check for this type of warning has been added).

these are the configure line and the used flags:
Code
CFLAGS='-march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables'
export CFLAGS
CXXFLAGS='-march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables'
export CXXFLAGS
FFLAGS='-march=i586 -mtune=i686 -fmessage-length=0 -O2 -Wall -D_FORTIFY_SOURCE=2 -fstack-protector -funwind-tables -fasynchronous-unwind-tables'
export FFLAGS
./configure --host=i686-suse-linux-gnu --build=i686-suse-linux-gnu --target=i586-suse-linux --program-prefix= --prefix=/usr --exec-prefix=/usr --bindir=/usr/bin --sbindir=/usr/sbin --sysconfdir=/etc --datadir=/usr/share --includedir=/usr/include --libdir=/usr/lib --libexecdir=/usr/lib --localstatedir=/var --sharedstatedir=/usr/com --mandir=/usr/share/man --infodir=/usr/share/info --with-wx-config=/usr/bin/wx-config --with-contrib-plugins=all

Regards
Daniel