Skip to content

Commit 0fd6679

Browse files
move bitmask
1 parent 607107e commit 0fd6679

File tree

2 files changed

+11
-14
lines changed

2 files changed

+11
-14
lines changed

code/logic/fossil/io/input.h

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,17 @@ typedef enum {
2626
FOSSIL_CTX_FILENAME
2727
} fossil_context_t;
2828

29+
/* Bitmask flags for string sanitization results */
30+
#define FOSSIL_SAN_OK 0x00 /* No issues detected; string is clean */
31+
#define FOSSIL_SAN_MODIFIED 0x01 /* Input was modified during sanitization */
32+
#define FOSSIL_SAN_SCRIPT 0x02 /* Script or JavaScript patterns detected */
33+
#define FOSSIL_SAN_SQL 0x04 /* SQL injection patterns detected */
34+
#define FOSSIL_SAN_SHELL 0x08 /* Shell or command execution patterns detected */
35+
#define FOSSIL_SAN_BASE64 0x10 /* Suspiciously long base64 sequences detected */
36+
#define FOSSIL_SAN_PATH 0x20 /* Path traversal or filesystem patterns detected */
37+
#define FOSSIL_SAN_BOT 0x40 /* Bot or automated agent patterns detected */
38+
#define FOSSIL_SAN_SPAM 0x80 /* Spam or suspicious marketing content detected */
39+
2940
#ifdef __cplusplus
3041
extern "C" {
3142
#endif

code/logic/input.c

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -127,20 +127,6 @@ static int strncase_contains(const char *haystack, const char *needle, size_t le
127127
return 0;
128128
}
129129

130-
/* ============================================================
131-
* Bitmask flags for detection
132-
* ============================================================ */
133-
#define FOSSIL_SAN_OK 0x00
134-
#define FOSSIL_SAN_MODIFIED 0x01
135-
#define FOSSIL_SAN_SCRIPT 0x02
136-
#define FOSSIL_SAN_SQL 0x04
137-
#define FOSSIL_SAN_SHELL 0x08
138-
#define FOSSIL_SAN_BASE64 0x10
139-
#define FOSSIL_SAN_PATH 0x20
140-
#define FOSSIL_SAN_BOT 0x40
141-
#define FOSSIL_SAN_SPAM 0x80
142-
143-
144130
// Function to trim leading and trailing spaces from a string
145131
void fossil_io_trim(char *str) {
146132
if (str == NULL) return;

0 commit comments

Comments
 (0)