From 88b21731fca0ef969e7759c03653421e2ca3aa22 Mon Sep 17 00:00:00 2001 From: Aidan MacDonald Date: Wed, 30 Mar 2022 21:20:02 +0100 Subject: 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 --- firmware/buflib.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'firmware/buflib.c') 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 -- cgit