Skip to content

Commit 46081a3

Browse files
committed
LocalIP (Linux): fixes incorrect return and ensures struct initialization
1 parent a5fd671 commit 46081a3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/detection/localip/localip_linux.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ static FFIPv6Type getIpType(struct ifaddrs* ifa)
179179
ffListInit(&addresses, sizeof(struct in6_addr));
180180
FF_STRBUF_AUTO_DESTROY buffer = ffStrbufCreate();
181181
if (!ffReadFileBuffer("/proc/net/if_inet6", &buffer))
182-
return true;
182+
return result;
183183

184184
char* line = NULL;
185185
size_t len = 0;
@@ -487,7 +487,7 @@ const char* ffDetectLocalIps(const FFLocalIpOptions* options, FFlist* results)
487487
{
488488
FF_LIST_FOR_EACH(FFLocalIpResult, iface, *results)
489489
{
490-
struct ifreq ifr;
490+
struct ifreq ifr = {};
491491
ffStrCopy(ifr.ifr_name, iface->name.chars, IFNAMSIZ);
492492

493493
if (options->showType & FF_LOCALIP_TYPE_MTU_BIT)

0 commit comments

Comments
 (0)