Skip to content

BUG: Fixed issue #5156: segfault on read_csv #5268

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 19, 2013

Conversation

guyrt
Copy link
Contributor

@guyrt guyrt commented Oct 19, 2013

closes #5156

Our c parser was not checking array bounds.

Example:

In [1]: from StringIO import StringIO; import pandas as pd

In [2]: data = """\     
1,2,3                      
4,,6
7,8,9                      
10,11,12\n"""

In [3]: df = pd.read_csv(StringIO(data), header=0, names=['a', 'b', 'c', 'd'], engine='c')
CParserError: Too many columns specified: expected 4 and found 3

Previously, this would segfault.

@@ -183,6 +183,7 @@ Improvements to existing features
- ``Series`` now supports a ``to_frame`` method to convert it to a single-column DataFrame (:issue:`5164`)
- DatetimeIndex (and date_range) can now be constructed in a left- or
right-open fashion using the ``closed`` parameter (:issue:`4579`)
- Python csv parser now supports usecols (:issue:`4335`)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was requested here: #5211

jreback added a commit that referenced this pull request Oct 19, 2013
BUG: Fixed issue #5156: segfault on read_csv
@jreback jreback merged commit 6f6b0df into pandas-dev:master Oct 19, 2013
@jreback
Copy link
Contributor

jreback commented Oct 19, 2013

thanks! helpful as always

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

BUG: read_csv with bad file coreing
2 participants