Permalink
Browse files

Make sure that edge records have the correct number of fields

  • Loading branch information...
1 parent ffe7e37 commit 32310ecde4a640e965c94800b78dad94859fe885 @jts committed Jan 25, 2012
Showing with 7 additions and 0 deletions.
  1. +7 −0 src/SQG/ASQG.cpp
View
@@ -266,6 +266,13 @@ void EdgeRecord::parse(const std::string& record)
// Tokenize record
StringVector tokens = SQG::tokenizeRecord(record);
+ if(tokens.size() < 2)
+ {
+ std::cerr << "Error: Edge record is incomplete.\n";
+ std::cerr << "Record: " << record << std::endl;
+ exit(EXIT_FAILURE);
+ }
+
// Ensure the first token indicates this is a valid edge record
if(tokens[0].compare(EDGE_TAG) != 0)
{

0 comments on commit 32310ec

Please sign in to comment.