From b84cdb54428bfe77168d9532704e4532c0ff0d1d Mon Sep 17 00:00:00 2001 From: Leandro Pereira Date: Sun, 26 Jul 2015 12:05:08 -0300 Subject: str_find_aux() might return a negative number It might return the return value of match_error(), which returns (-1). --- httpd/patterns.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpd/patterns.c b/httpd/patterns.c index 27a813f..34bd52b 100644 --- a/httpd/patterns.c +++ b/httpd/patterns.c @@ -673,7 +673,7 @@ str_match(const char *string, const char *pattern, struct str_match *m, memset(m, 0, sizeof(*m)); ret = str_find_aux(&ms, pattern, string, sm, nsm, 0); - if (ret == 0 || ms.error != NULL) { + if (ret <= 0 || ms.error != NULL) { /* Return -1 on error and store the error string */ *errstr = ms.error; return (-1); -- cgit v1.2.3-54-g00ecf