From fdca2a8ca7fb6017cb87b520369cbc723faa5ba8 Mon Sep 17 00:00:00 2001 From: Danila Fedorin Date: Fri, 10 Aug 2018 16:54:39 -0700 Subject: [PATCH] Add more sanitizing characters. --- src/libabacus.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libabacus.c b/src/libabacus.c index ade5d8b..f83ddd9 100644 --- a/src/libabacus.c +++ b/src/libabacus.c @@ -87,7 +87,9 @@ libab_result libab_init(libab* ab, void* (*parse_function)(const char*), void _sanitize(char* to, const char* from, size_t buffer_size) { size_t index = 0; while (*from && index < (buffer_size - 2)) { - if (*from == '+' || *from == '*' || *from == '\\') + if (*from == '+' || *from == '*' || *from == '\\' || + *from == '|' || *from == '[' || *from == ']' || *from == '(' || + *from == ')') to[index++] = '\\'; to[index++] = *(from++); }