ctrouille
ctrouille is a static analyser for the C language: it reads a program without running it and points out the defects that make it crash or open a security…
📖 Beschrijving
A second pair of eyes on your C code
ctrouille is a static analyser for the C language: it reads a program without running it and points out the defects that make it crash or open a security hole. Null pointers, memory used after being freed, leaks, buffer overflows, uninitialised variables, divisions by zero, unsafe format strings: the errors that compile without a warning and only show up in production.
Try it online
The demo opens on a small program. A function looks for a sensor and returns NULL when it does not find it; one caller checks the result, the other does not. ctrouille flags the second one, at the line where the pointer is dereferenced, and shows where the NULL comes from. The caller that checks gets nothing: ctrouille tells the two apart.
Eight examples are ready to try, one per kind of defect. Edit the code as you like, then run the analysis again (Ctrl+Enter). Everything runs in your browser: your code never leaves your machine.
Reading a finding
Each finding says:
- how serious it is: error, warning or note, also shown as a coloured dot in the margin of the code;
- the rule that detected it;
- the CWE it corresponds to, the public catalogue of software weaknesses, with its name;
- for a defect that depends on the path the program takes, the lines that lead to it, from where the problem starts to where it strikes.
Click a line number and the code scrolls to it.
Security and coding standards
The tabs sort the findings by what they answer to: weaknesses listed in the CWE, the MISRA C rules (the coding standard of the automotive and embedded industries) and CERT C (secure coding). The same analysis serves the developer who hunts bugs and the team that must prove its code follows a standard.
💬 User reviews
No reviews yet. Be the first to leave one.