From: Ruediger Pluem Date: Wed, 27 Apr 2022 06:35:02 +0000 (+0000) Subject: * Avoid an overflow on large inputs X-Git-Tag: 2.5.0-alpha2-ci-test-only~368 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e2e1d779179d1c9a053e61fa4a3776a5faf7d653;p=thirdparty%2Fapache%2Fhttpd.git * Avoid an overflow on large inputs PR: 66033 git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/trunk@1900306 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/changes-entries/pr66033.txt b/changes-entries/pr66033.txt new file mode 100644 index 00000000000..caa98d18cd9 --- /dev/null +++ b/changes-entries/pr66033.txt @@ -0,0 +1,2 @@ + *) core: Avoid an overflow on large inputs in ap_is_matchexp. PR 66033 + [Ruediger Pluem] diff --git a/server/util.c b/server/util.c index c49274d6560..c57258aeb39 100644 --- a/server/util.c +++ b/server/util.c @@ -251,10 +251,8 @@ AP_DECLARE(int) ap_os_is_path_absolute(apr_pool_t *p, const char *dir) AP_DECLARE(int) ap_is_matchexp(const char *str) { - int x; - - for (x = 0; str[x]; x++) - if ((str[x] == '*') || (str[x] == '?')) + for (; *str; str++) + if ((*str == '*') || (*str == '?')) return 1; return 0; }