Skip to content

Commit

Permalink
[Bug](CSVReader) fix null pointer coredump in CSVReader in p2
Browse files Browse the repository at this point in the history
  • Loading branch information
HappenLee committed Jul 14, 2023
1 parent 7a61953 commit 21e8ab7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions be/src/vec/exec/format/csv/csv_reader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ CsvReader::CsvReader(RuntimeState* state, RuntimeProfile* profile, ScannerCounte
_file_reader(nullptr),
_line_reader(nullptr),
_line_reader_eof(false),
_text_converter(nullptr),
_text_converter(new(std::nothrow) TextConverter('\\')),
_decompressor(nullptr),
_skip_lines(0),
_io_ctx(io_ctx) {
Expand All @@ -91,7 +91,6 @@ CsvReader::CsvReader(RuntimeState* state, RuntimeProfile* profile, ScannerCounte
_file_compress_type = _params.compress_type;
_size = _range.size;

_text_converter.reset(new (std::nothrow) TextConverter('\\', _array_delimiter[0]));
_split_values.reserve(sizeof(Slice) * _file_slot_descs.size());
_init_system_properties();
_init_file_description();
Expand All @@ -107,7 +106,7 @@ CsvReader::CsvReader(RuntimeProfile* profile, const TFileScanRangeParams& params
_file_slot_descs(file_slot_descs),
_line_reader(nullptr),
_line_reader_eof(false),
_text_converter(nullptr),
_text_converter(new(std::nothrow) TextConverter('\\')),
_decompressor(nullptr),
_io_ctx(io_ctx) {
_file_format_type = _params.format_type;
Expand Down

0 comments on commit 21e8ab7

Please sign in to comment.