From: Andrew Rodland Date: Tue, 10 Oct 2023 17:30:28 +0000 (-0400) Subject: Fix null pointer access in proxy_set X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=2f09056800000c8e5d3c72869555f4b1a7cea10a;p=project%2Fomcproxy.git Fix null pointer access in proxy_set We were checking `proxy->ifindex`, but `proxy` is initialized to NULL. Should be checking `p->ifindex` instead. Signed-off-by: Andrew Rodland --- diff --git a/src/proxy.c b/src/proxy.c index 67c91a7..8114763 100644 --- a/src/proxy.c +++ b/src/proxy.c @@ -126,7 +126,7 @@ int proxy_set(int uplink, const int downlinks[], size_t downlinks_cnt, enum prox { struct proxy *proxy = NULL, *p; list_for_each_entry(p, &proxies, head) - if (proxy->ifindex == uplink) + if (p->ifindex == uplink) proxy = p; if (proxy && (downlinks_cnt == 0 ||