From: Andreas Seltenreich Date: Thu, 3 Mar 2016 19:08:35 +0000 (+0100) Subject: CLEANUP: pattern: Ignore unknown samples in pat_match_ip(). X-Git-Tag: v1.7-dev2~66 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f0653192e31d3baa95ead5501b5cda467ab15b6d;p=thirdparty%2Fhaproxy.git CLEANUP: pattern: Ignore unknown samples in pat_match_ip(). Ignore samples that are neither SMP_T_IPV4 nor SMP_T_IPV6 instead of matching with an uninitialized value in this case. This situation should not occur in the current codebase but triggers warnings in static code analysis tools. Found in haproxy 1.5. --- diff --git a/src/pattern.c b/src/pattern.c index b4cb8e9ea6..9d07b89c5a 100644 --- a/src/pattern.c +++ b/src/pattern.c @@ -1021,6 +1021,9 @@ struct pattern *pat_match_ip(struct sample *smp, struct pattern_expr *expr, int } else continue; + } else { + /* impossible */ + continue; } /* Check if the input sample match the current pattern. */