csv: avoid invalid dereference

This commit is contained in:
Dane Springmeyer 2011-11-14 00:34:26 -08:00
parent 39d199aa49
commit 41663b1941

View file

@ -303,7 +303,9 @@ void csv_datasource::parse_csv(T& stream,
{ {
Tokenizer tok(csv_line, grammer); Tokenizer tok(csv_line, grammer);
Tokenizer::iterator beg = tok.begin(); Tokenizer::iterator beg = tok.begin();
std::string val = boost::trim_copy(*beg); std::string val;
if (beg != tok.end())
val = boost::trim_copy(*beg);
// skip blank lines // skip blank lines
if (val.empty()) if (val.empty())