summaryrefslogtreecommitdiffstats
path: root/firmware/buflib.c
diff options
context:
space:
mode:
authorAidan MacDonald <amachronic@protonmail.com>2022-03-30 21:20:02 +0100
committerAidan MacDonald <amachronic@protonmail.com>2022-09-19 15:09:51 -0400
commit88b21731fca0ef969e7759c03653421e2ca3aa22 (patch)
tree1152437f1980adb7c1dffbac1da4db0178bb95c7 /firmware/buflib.c
parent8f896b14d32cb338bb18489f3503eedd189c2dc4 (diff)
downloadrockbox-88b21731fc.tar.gz
rockbox-88b21731fc.zip
buflib: enable all paranoia checks
Since allocation is infrequent in Rockbox enabling the extra checks to catch memory corruption is probably worth the time and code size cost. Change-Id: If0d701421054328c57b69e4d0af30759d799d158
Diffstat (limited to 'firmware/buflib.c')
-rw-r--r--firmware/buflib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/firmware/buflib.c b/firmware/buflib.c
index 5cdb0f7ecd..52d52459a4 100644
--- a/firmware/buflib.c
+++ b/firmware/buflib.c
@@ -103,7 +103,9 @@
#define PARANOIA_CHECK_BLOCK_HANDLE (1 << 2)
#define PARANOIA_CHECK_CRC (1 << 3)
/* Bitmask of enabled paranoia checks */
-#define BUFLIB_PARANOIA 0
+#define BUFLIB_PARANOIA \
+ (PARANOIA_CHECK_LENGTH | PARANOIA_CHECK_HANDLE | \
+ PARANOIA_CHECK_BLOCK_HANDLE | PARANOIA_CHECK_CRC)
#if BUFLIB_PARANOIA & PARANOIA_CHECK_CRC
# define BUFLIB_HAS_CRC