mirror of
https://github.com/nmap/nmap.git
synced 2025-12-11 10:19:03 +00:00
Avoid crashing with non-integer geometry in zenmap.conf
This commit is contained in:
@@ -340,6 +340,11 @@ class WindowConfig(UmitConfigParser, object):
|
|||||||
value = int(self._get_it("x", self.default_x))
|
value = int(self._get_it("x", self.default_x))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
value = self.default_x
|
value = self.default_x
|
||||||
|
except TypeError as e:
|
||||||
|
v = self._get_it("x", self.default_x)
|
||||||
|
log.exception("Trouble parsing x value as int: %s",
|
||||||
|
repr(v), exc_info=e)
|
||||||
|
value = self.default_x
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def set_x(self, x):
|
def set_x(self, x):
|
||||||
@@ -350,6 +355,11 @@ class WindowConfig(UmitConfigParser, object):
|
|||||||
value = int(self._get_it("y", self.default_y))
|
value = int(self._get_it("y", self.default_y))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
value = self.default_y
|
value = self.default_y
|
||||||
|
except TypeError as e:
|
||||||
|
v = self._get_it("y", self.default_y)
|
||||||
|
log.exception("Trouble parsing y value as int: %s",
|
||||||
|
repr(v), exc_info=e)
|
||||||
|
value = self.default_y
|
||||||
return value
|
return value
|
||||||
|
|
||||||
def set_y(self, y):
|
def set_y(self, y):
|
||||||
@@ -360,6 +370,11 @@ class WindowConfig(UmitConfigParser, object):
|
|||||||
value = int(self._get_it("width", self.default_width))
|
value = int(self._get_it("width", self.default_width))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
value = self.default_width
|
value = self.default_width
|
||||||
|
except TypeError as e:
|
||||||
|
v = self._get_it("width", self.default_width)
|
||||||
|
log.exception("Trouble parsing width value as int: %s",
|
||||||
|
repr(v), exc_info=e)
|
||||||
|
value = self.default_width
|
||||||
|
|
||||||
if not (value >= -1):
|
if not (value >= -1):
|
||||||
value = self.default_width
|
value = self.default_width
|
||||||
@@ -374,6 +389,11 @@ class WindowConfig(UmitConfigParser, object):
|
|||||||
value = int(self._get_it("height", self.default_height))
|
value = int(self._get_it("height", self.default_height))
|
||||||
except ValueError:
|
except ValueError:
|
||||||
value = self.default_height
|
value = self.default_height
|
||||||
|
except TypeError as e:
|
||||||
|
v = self._get_it("height", self.default_height)
|
||||||
|
log.exception("Trouble parsing y value as int: %s",
|
||||||
|
repr(v), exc_info=e)
|
||||||
|
value = self.default_height
|
||||||
|
|
||||||
if not (value >= -1):
|
if not (value >= -1):
|
||||||
value = self.default_height
|
value = self.default_height
|
||||||
|
|||||||
Reference in New Issue
Block a user