From 6bd7492f74c2700ab3fc8d99b84e5c68100961e2 Mon Sep 17 00:00:00 2001 From: Douglas Barone Date: Tue, 6 Apr 2021 08:56:33 -0400 Subject: [PATCH] Bugfix: verify ip before net.contains --- server/src/lib/paloalto.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/lib/paloalto.js b/server/src/lib/paloalto.js index 04028eb..4e1b524 100644 --- a/server/src/lib/paloalto.js +++ b/server/src/lib/paloalto.js @@ -69,7 +69,9 @@ async function updateUserIdMappings() { const net = ip.cidrSubnet(pAHost.cidr) - const devices = allDevices.filter(device => net.contains(device.ip)) + const devices = allDevices.filter( + ({ ip }) => isIPv4(ip) && net.contains(ip) + ) try { // console.log(pAHost.id, pAHost.description, devices.length)