mirror of
https://github.com/mirror/wget.git
synced 2025-01-07 02:40:55 +08:00
* 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
This commit is contained in:
parent
e737c4b10e
commit
64758655c4
@ -2444,6 +2444,11 @@ void *
|
|||||||
compile_posix_regex (const char *str)
|
compile_posix_regex (const char *str)
|
||||||
{
|
{
|
||||||
regex_t *regex = xmalloc (sizeof (regex_t));
|
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);
|
int errcode = regcomp ((regex_t *) regex, str, REG_EXTENDED | REG_NOSUB);
|
||||||
if (errcode != 0)
|
if (errcode != 0)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user