Skip to content

Commit c1f5016

Browse files
committed
slips_utils: make sure the given str is an ip before converting it to ip_address obj
1 parent d78e85c commit c1f5016

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

slips_files/common/slips_utils.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -397,6 +397,9 @@ def is_port_in_use(self, port: int) -> bool:
397397
def is_private_ip(
398398
self, ip: Union[ipaddress.IPv4Address, ipaddress.IPv6Address, str]
399399
) -> bool:
400+
if self.detect_ioc_type(ip) != "ip":
401+
return False
402+
400403
ip_classes = {ipaddress.IPv4Address, ipaddress.IPv6Address}
401404
for class_ in ip_classes:
402405
if isinstance(ip, class_):

0 commit comments

Comments
 (0)