tor/scripts/coccinelle
Nick Mathewson 387cfccee4 Add a coccinelle script to look for {inc,dec}rements in log_debug
We want to forbid this pattern since, unlike the other log_*()
macros, log_debug() conditionally evaluates its arguments only if
debug-level logging is enabled.  Thus, a call to
    log_debug("%d", x++);
will only increment x if debugging logs are enabled, which is
probably not what the programmer intended.

One bug caused by this pattern was #30628.

This script detects log_debug( ) calls with any of E++, E--, ++E,
or --E in their arguments, where E is an arbitrary expression.

Closes ticket 30743.
2019-09-18 13:43:42 -04:00
..
calloc.cocci Add a rule to the calloc semantic patch for argument ordering. 2014-11-02 11:54:42 -05:00
ceil_div.cocci Add Coccinelle patch for detecing places where CEIL_DIV should be used. 2017-08-24 15:20:11 -04:00
ctrl-reply-cleanup.cocci Coccinelle scripts for control.c refactor 2019-04-30 13:18:46 -05:00
ctrl-reply.cocci Coccinelle scripts for control.c refactor 2019-04-30 13:18:46 -05:00
debugmm.cocci Add a coccinelle script to look for {inc,dec}rements in log_debug 2019-09-18 13:43:42 -04:00
malloc_cast.cocci Add script to detect and remove unCish malloc-then-cast pattern 2014-09-16 10:57:00 -04:00
test_assert_int.cocci Add Coccinelle patch for replacing tt_assert() usage on integer types. 2017-08-24 15:21:43 -04:00
test_assert_null.cocci Add Coccinelle patch for replacing NULL/non-NULL tt_assert(). 2017-08-24 15:22:20 -04:00
test_assert_zero.cocci Add Coccinelle patch for replacing tt_assert(0) with tt_abort(). 2017-08-24 15:21:07 -04:00
test-operator-cleanup Add script for cleaning op operator usage in test files. 2017-08-24 15:19:11 -04:00
tor-coccinelle.h Coccinelle scripts for control.c refactor 2019-04-30 13:18:46 -05:00
uncalloc.cocci Add coccinelle script to remove pointless callocs 2014-09-16 11:11:17 -04:00