Skip to content

Commit

Permalink
Avoid out of bounds access in read_csv
Browse files Browse the repository at this point in the history
If one passes an empty list for the names, things should work.
  • Loading branch information
wence- committed Jul 9, 2024
1 parent b00a8ea commit 6530c2c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion python/cudf/cudf/_lib/csv.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -450,7 +450,7 @@ def read_csv(
col_name = df._data.names[index]
df._data[col_name] = df._data[col_name].astype(col_dtype)

if names is not None and isinstance(names[0], (int)):
if names is not None and len(names) and isinstance(names[0], (int)):
df.columns = [int(x) for x in df._data]

# Set index if the index_col parameter is passed
Expand Down

0 comments on commit 6530c2c

Please sign in to comment.