Skip to content

Commit 8f6345d

Browse files
committed
Fix possible invalid memory accesses
1 parent 0ef1cff commit 8f6345d

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

include/internal/csv_row.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,8 @@ namespace csv {
197197
this->daddy->operator[](_i));
198198
else
199199
this->field = nullptr;
200+
201+
this->data = this->daddy->data;
200202
}
201203

202204
CSV_INLINE CSVRow::iterator::reference CSVRow::iterator::operator*() const {

include/internal/csv_row.hpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ namespace csv {
374374

375375
private:
376376
const CSVRow * daddy = nullptr; // Pointer to parent
377+
internals::RawCSVDataPtr data = nullptr;
377378
std::shared_ptr<CSVField> field = nullptr; // Current field pointed at
378379
int i = 0; // Index of current field
379380
};

0 commit comments

Comments
 (0)