aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--g10/trustdb.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/g10/trustdb.c b/g10/trustdb.c
index c9c88913b..bc90161e9 100644
--- a/g10/trustdb.c
+++ b/g10/trustdb.c
@@ -1823,6 +1823,10 @@ clean_key(KBNODE keyblock,int noisy,int self_only,
/* Returns a sanitized copy of the regexp (which might be "", but not
NULL). */
#ifndef DISABLE_REGEX
+/* Operator charactors except '.' and backslash.
+ See regex(7) on BSD. */
+#define REGEXP_OPERATOR_CHARS "^[$()|*+?{"
+
static char *
sanitize_regexp(const char *old)
{
@@ -1862,7 +1866,7 @@ sanitize_regexp(const char *old)
{
if(!escaped && old[start]=='\\')
escaped=1;
- else if(!escaped && old[start]!='.')
+ else if (!escaped && strchr (REGEXP_OPERATOR_CHARS, old[start]))
new[idx++]='\\';
else
escaped=0;