From 2f09056800000c8e5d3c72869555f4b1a7cea10a Mon Sep 17 00:00:00 2001 From: Andrew Rodland Date: Tue, 10 Oct 2023 13:30:28 -0400 Subject: [PATCH] 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 --- src/proxy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 || -- 2.30.2