mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-15 10:11:29 +08:00
This patch adds coccinelle scripts for detecting use-after-free bugs in relation to ts_cache_release. This will find code using the following pattern: Use of the hypertable from cache after releasing the cache and use of the dimension of the hypertable from a cache after the cache was released.
19 lines
381 B
Bash
Executable File
19 lines
381 B
Bash
Executable File
#!/bin/bash
|
|
|
|
set -o pipefail
|
|
|
|
SCRIPT_DIR=$(dirname "${0}")
|
|
FAILED=false
|
|
true > coccinelle.diff
|
|
|
|
for f in "${SCRIPT_DIR}"/../coccinelle/*.cocci; do
|
|
find "${SCRIPT_DIR}"/.. -name '*.c' -exec spatch --very-quiet -sp_file "$f" {} + | tee -a coccinelle.diff
|
|
rc=$?
|
|
if [ $rc -ne 0 ]; then
|
|
FAILED=true
|
|
fi
|
|
done
|
|
|
|
if [ $FAILED = true ] || [ -s coccinelle.diff ] ; then exit 1; fi
|
|
|