mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-14 17:43:34 +08:00
NameData is a fixed-size type of 64 bytes. Using strlcpy to copy data into a NameData struct can cause problems because any data that follows the initial null-terminated string will also be part of the data.
This directory contains scripts to check the codebase for defective programming patterns, eg use after free or not freeing resources.
Coccinelle is a static code analysis program. It uses a semantic patch language which resembles unified diff output. The semantic patches may inline python or ocaml code for more advanced use cases.
A coccinelle patch file consists of multiple blocks. Example block header:
@ name @
Expression var1;
Expression var2;
@@
The block header may contain variable definitions. It may also contain required matches or non-matches in previous blocks. Examples for blocks with required previous matches:
@ b2 depends on name @
@@
@ b3 depends on name && !b2 @
@@
Variables inside a block can also reference matches from previous blocks.
@ b2 depends on name @
Expression name.var1;
@@
var1 inside this block will be the match from the name
block.