match: Limit recursion to 16

This is more than enough as it reflects to 16 asterisks in the match
string is more than enough. With larger values oss-fuzz was generating
long match strings with asterisks interleaved with normal characters,
which were timing out.

Signed-off-by: Jakub Jelen <jjelen@redhat.com>
Reviewed-by: Andreas Schneider <asn@cryptomilk.org>
This commit is contained in:
Jakub Jelen
2022-02-09 17:29:41 +01:00
parent 354438e758
commit bf7149f205

View File

@@ -43,7 +43,7 @@
#include "libssh/priv.h"
#define MAX_MATCH_RECURSION 32
#define MAX_MATCH_RECURSION 16
/*
* Returns true if the given string matches the pattern (which may contain ?