Skip to content

Commit d8182e1

Browse files
committed
Merge pull request #11138 from evanpw/read_csv_overflow
TST: Verify fix for buffer overflow in read_csv with engine='c'
2 parents d28fd70 + 3ff37b7 commit d8182e1

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

pandas/io/tests/test_parsers.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2293,6 +2293,13 @@ def test_chunk_begins_with_newline_whitespace(self):
22932293
result = self.read_csv(StringIO(data), header=None)
22942294
self.assertEqual(len(result), 2)
22952295

2296+
# GH 9735
2297+
chunk1 = 'a' * (1024 * 256 - 2) + '\na'
2298+
chunk2 = '\n a'
2299+
result = pd.read_csv(StringIO(chunk1 + chunk2), header=None)
2300+
expected = pd.DataFrame(['a' * (1024 * 256 - 2), 'a', ' a'])
2301+
tm.assert_frame_equal(result, expected)
2302+
22962303
def test_empty_with_index(self):
22972304
# GH 10184
22982305
data = 'x,y'

0 commit comments

Comments
 (0)