regehr / itc-benchmarks Goto Github PK
View Code? Open in Web Editor NEWstatic analysis benchmarks from Toyota ITC
License: Other
static analysis benchmarks from Toyota ITC
License: Other
For the last example,
void data_underflow_012 ()
{
int min = -2147483647;
int dlist[4] = {0, 1, -2, -1};
int ret;
ret = min - dlist[2]; /Tool should detect this line as error/ /ERROR:Data underflow/
}
min - (-2) = min + 2; it will not be an error
If I'm reading things correctly, https://github.com/regehr/itc-benchmarks/blob/master/01.w_Defects/free_null_pointer.c is a test that a verifier complains about a free of a NULL pointer.
However, it's legal to call free
on a NULL pointer;
to quote "7.20.3.2 The free function" of http://www.open-std.org/JTC1/SC22/wg14/www/docs/n1124.pdf
If ptr is a null pointer, no action occurs
If so, are these tests requiring false positives? (or am I misunderstanding things?)
Hope this is constructive
Hi, first place, good work for making these test cases available! Thanks!
Autoconf is generating Makefiles with CFLAGS='-g -O2', and -O2 will optimized lots of parts of the code since most of it just exist to support the vulnerability.
For example: https://github.com/regehr/itc-benchmarks/blob/master/01.w_Defects/free_null_pointer.c#L452, should receive a SIGSEGV, since ptr is NULL and is being accessed. But it actually doesn't crash since -O2 is on, so GCC optimized out that line.
I'd recommend adding the following line to your README.md:
./configure CFLAGS='-g' CXXFLAGS='-g', will prevent from passing -O to GCC
in case someone wants to make binary analysis.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.