From 46081a3e52d671ac6cb5bbc80899333656485c59 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Sat, 16 Aug 2025 04:24:26 +0000 Subject: [PATCH] LocalIP (Linux): fixes incorrect return and ensures struct initialization --- src/detection/localip/localip_linux.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/localip/localip_linux.c b/src/detection/localip/localip_linux.c index 3d1a7cd87..a4c82bb88 100644 --- a/src/detection/localip/localip_linux.c +++ b/src/detection/localip/localip_linux.c @@ -179,7 +179,7 @@ static FFIPv6Type getIpType(struct ifaddrs* ifa) ffListInit(&addresses, sizeof(struct in6_addr)); FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate(); if (!ffReadFileBuffer("/proc/net/if_inet6", &buffer)) - return true; + return result; char* line = NULL; size_t len = 0; @@ -487,7 +487,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results) { FF_LIST_FOR_EACH(FFLocalIpResult, iface, *results) { - struct ifreq ifr; + struct ifreq ifr = {}; ffStrCopy(ifr.ifr_name, iface->name.chars, IFNAMSIZ); if (options->showType & FF_LOCALIP_TYPE_MTU_BIT)