mirror of
https://github.com/python/cpython.git
synced 2025-09-26 18:29:57 +00:00
Fix an off by one error on negative indexs to __getitem__
http://code.google.com/p/ipaddr-py/issues/detail?id=15
This commit is contained in:
parent
f7f858d141
commit
5edb1a1b0a
2 changed files with 12 additions and 0 deletions
|
@ -209,6 +209,7 @@ class BaseIP(object):
|
|||
raise IndexError
|
||||
return self._string_from_ip_int(self.network + n)
|
||||
else:
|
||||
n += 1
|
||||
if self.broadcast + n < self.network:
|
||||
raise IndexError
|
||||
return self._string_from_ip_int(self.broadcast + n)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue