From e2e1d779179d1c9a053e61fa4a3776a5faf7d653 Mon Sep 17 00:00:00 2001 From: Ruediger Pluem Date: Wed, 27 Apr 2022 06:35:02 +0000 Subject: * 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 --- changes-entries/pr66033.txt | 2 ++ server/util.c | 6 ++---- 2 files changed, 4 insertions(+), 4 deletions(-) create mode 100644 changes-entries/pr66033.txt diff --git a/changes-entries/pr66033.txt b/changes-entries/pr66033.txt new file mode 100644 index 0000000000..caa98d18cd --- /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 c49274d656..c57258aeb3 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; } -- cgit v1.2.1