From 64758655c4ef8bc83dd3aae87c8972988a2c2434 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim=20R=C3=BChsen?= Date: Mon, 16 Apr 2018 22:04:50 +0200 Subject: [PATCH] * src/utils.c (compile_posix_regex): Hard-code string to regcomp regcomp() may be too cpu + memory intensive for fuzzing. See https://sourceware.org/glibc/wiki/Security%20Exceptions --- src/utils.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/utils.c b/src/utils.c index ca7726e3..15a7c96d 100644 --- a/src/utils.c +++ b/src/utils.c @@ -2444,6 +2444,11 @@ void * compile_posix_regex (const char *str) { regex_t *regex = xmalloc (sizeof (regex_t)); +#ifdef TESTING + /* regcomp might be *very* cpu+memory intensive, + * see https://sourceware.org/glibc/wiki/Security%20Exceptions */ + str = "a"; +#endif int errcode = regcomp ((regex_t *) regex, str, REG_EXTENDED | REG_NOSUB); if (errcode != 0) {