From dbca297b4c3843ee82fa0531f47543a5cbb6f9d3 Mon Sep 17 00:00:00 2001 From: dequis Date: Wed, 9 Dec 2015 04:46:21 -0300 Subject: proxy: fix validation of the proxytype value Coverity says it could be an out of bounds read, but the value is set internally, so not really. Still, good point about the condition being wrong. --- lib/proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/proxy.c b/lib/proxy.c index af30cf4f..61a89f59 100644 --- a/lib/proxy.c +++ b/lib/proxy.c @@ -541,7 +541,7 @@ int proxy_connect(const char *host, int port, b_event_handler func, gpointer dat phb->func = func; phb->data = data; - if (proxyhost[0] && proxyport > 0 && proxytype >= 0 && proxytype <= G_N_ELEMENTS(proxy_connect_funcs_array)) { + if (proxyhost[0] && proxyport > 0 && proxytype >= 0 && proxytype < G_N_ELEMENTS(proxy_connect_funcs_array)) { fun = proxy_connect_funcs_array[proxytype]; } else { fun = proxy_connect_none; -- cgit v1.2.3