]> granicus.if.org Git - apache/commitdiff
Merge r1812307 from trunk:
authorJoe Orton <jorton@apache.org>
Tue, 17 Oct 2017 08:06:13 +0000 (08:06 +0000)
committerJoe Orton <jorton@apache.org>
Tue, 17 Oct 2017 08:06:13 +0000 (08:06 +0000)
* server/util_expr_eval.c (ap_expr_eval_re_backref): Fix gcc 7.x warning.

util_expr_eval.c: In function ‘ap_expr_eval_re_backref’:
util_expr_eval.c:265:63: error: comparison between pointer and zero character constant [-Werror=pointer-compare]
     if (!ctx->re_pmatch || !ctx->re_source || *ctx->re_source == '\0' ||

Reviewed by: rjung, ylavic, jorton

git-svn-id: https://svn.apache.org/repos/asf/httpd/httpd/branches/2.4.x@1812367 13f79535-47bb-0310-9956-ffa450edef68

server/util_expr_eval.c

index a24eaef67bd3ce7159a212bb0ecb3a1378b4663d..91f5c3515a99af57e1651feecef7ee45d7d3bdea 100644 (file)
@@ -189,8 +189,8 @@ static const char *ap_expr_eval_re_backref(ap_expr_eval_ctx_t *ctx, unsigned int
 {
     int len;
 
-    if (!ctx->re_pmatch || !ctx->re_source || *ctx->re_source == '\0' ||
-        ctx->re_nmatch < n + 1)
+    if (!ctx->re_pmatch || !ctx->re_source || !*ctx->re_source
+        || **ctx->re_source == '\0' || ctx->re_nmatch < n + 1)
         return "";
 
     len = ctx->re_pmatch[n].rm_eo - ctx->re_pmatch[n].rm_so;