summaryrefslogtreecommitdiffstats
path: root/Lib/ipaddr.py
diff options
context:
space:
mode:
authorGregory P. Smith <greg@mad-scientist.com>2009-05-08 23:16:47 (GMT)
committerGregory P. Smith <greg@mad-scientist.com>2009-05-08 23:16:47 (GMT)
commit5edb1a1b0add465bae25121ee4278a9ec6009005 (patch)
tree878bd2a604f2ccac2ec56626b0525adb3a60ea66 /Lib/ipaddr.py
parentf7f858d1415514cb9a76a5b7da8ee6ccb774e6f4 (diff)
downloadcpython-5edb1a1b0add465bae25121ee4278a9ec6009005.zip
cpython-5edb1a1b0add465bae25121ee4278a9ec6009005.tar.gz
cpython-5edb1a1b0add465bae25121ee4278a9ec6009005.tar.bz2
Fix an off by one error on negative indexs to __getitem__
http://code.google.com/p/ipaddr-py/issues/detail?id=15
Diffstat (limited to 'Lib/ipaddr.py')
-rw-r--r--Lib/ipaddr.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/Lib/ipaddr.py b/Lib/ipaddr.py
index b5518ed..7289e45 100644
--- a/Lib/ipaddr.py
+++ b/Lib/ipaddr.py
@@ -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)