mirror of
https://github.com/9001/copyparty.git
synced 2026-02-27 05:53:11 -07:00
vc: add extra parse_version checks
This commit is contained in:
parent
faa6ff1861
commit
68aeb98ee5
|
|
@ -1788,11 +1788,15 @@ class SvcHub(object):
|
||||||
self.log("stacks", zs)
|
self.log("stacks", zs)
|
||||||
|
|
||||||
def parse_version(self, ver: str) -> tuple:
|
def parse_version(self, ver: str) -> tuple:
|
||||||
|
if not ver or not isinstance(ver, str):
|
||||||
|
return (0, 0, 0)
|
||||||
match = re.search(r'[\d.]+', ver)
|
match = re.search(r'[\d.]+', ver)
|
||||||
if not match:
|
if not match:
|
||||||
return (0, 0, 0)
|
return (0, 0, 0)
|
||||||
clean = match.group(0).strip('.')
|
parts = [int(x) for x in match.group(0).split(".")]
|
||||||
return tuple(int(x) for x in clean.split("."))
|
while len(parts) < 3:
|
||||||
|
parts.append(0)
|
||||||
|
return tuple(parts[:3])
|
||||||
|
|
||||||
def get_vuln_cache_path(self) -> str:
|
def get_vuln_cache_path(self) -> str:
|
||||||
return os.path.join(self.E.cfg, "vuln_advisory.json")
|
return os.path.join(self.E.cfg, "vuln_advisory.json")
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue