Series.iloc[ negative number ] can access memory it doesn't own or cause Segmentation Fault · Issue #10779 · pandas-dev/pandas (original) (raw)
In other words, there is no bounds checking for Series.iloc[] with a negative argument. It just accesses whatever is in the memory there. Also a security breach.
It does appear to check on write, just not on read.
Python 2.7.10 |Anaconda 2.1.0 (64-bit)| (default, May 28 2015, 17:02:03)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://binstar.org
import pandas as pd
pd>>> pd.version
'0.16.2'
s = pd.Series([1,2,3])
s
0 1
1 2
2 3
dtype: int64
s.iloc[-2]
2
s.iloc[-4]
33
s.iloc[-12345]
0
s.iloc[-123123123123123]
Segmentation fault (core dumped)