yakra / tmtools

Tools to aid in development of the TravelMapping project
0 stars 0 forks source link

highway.cpp: blank WPT line causes segfault #18

Closed yakra closed 6 years ago

yakra commented 6 years ago

A blank line in a WPT file will cause a Segmentation fault. Even if it has a space or two on it.

This may happen in BuildRte in highway.cpp. Maybe when strtok is called. Maybe before. Maybe after. Maybe somewhere else.

Pinpoint where this occurs and devise a way to deal with it.

Extra credit: figure out if it's feasible and worthwhile to use a 0-byte input WPT for SegDumping purposes.

yakra commented 6 years ago

This may happen in BuildRte in highway.cpp.

It does.

Maybe when strtok is called. Maybe before. Maybe after. Maybe somewhere else.

After: point.URL = point.label.back(); when point.label.empty()

devise a way to deal with it.

put point.URL = point.label.back(); and the rest of the while loop inside an IF. Simple.

Extra credit: figure out if it's feasible and worthwhile to use a 0-byte input WPT for SegDumping purposes.

Not worthwhile.

yakra commented 6 years ago

fixed in 2fcb8b9f9bdea08599184edf9f7b00350b023ec9