From 2119ba215aacf0b3964694a34aa39037e032abf6 Mon Sep 17 00:00:00 2001 From: Stanislav Malyshev Date: Mon, 28 Mar 2022 10:52:34 -0600 Subject: [PATCH] Don't try to access memory outside string --- ext/filter/logical_filters.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/filter/logical_filters.c b/ext/filter/logical_filters.c index b5747367628..ad011568aac 100644 --- a/ext/filter/logical_filters.c +++ b/ext/filter/logical_filters.c @@ -509,7 +509,7 @@ static int _php_filter_validate_domain(char * domain, size_t len, zend_long flag t = e - 1; /* Ignore trailing dot */ - if (*t == '.') { + if (l > 0 && *t == '.') { e = t; l--; }