Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Check for index in path node list when parsing connection #296

Merged

Conversation

greenscientist
Copy link
Contributor

We had an issue when the data got corrupted and the number of entry in the path was not the same as in the schedule. This was corrupting the memory. We use the at() instead of [] when accessing the vector in the parsing loop in getSchedules() and we display a meaningful error message if we get the exceptiono

@@ -116,7 +117,10 @@ namespace TrRouting
));

trip.connectionDepartureTimes[nodeTimeI] = departureTimesSeconds[nodeTimeI];

} catch (std::out_of_range const& exc) {
spdlog::error("Index out of range will parsing connection for trip on line ({})", path.line.longname);
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while instead of will?

We had an issue when the data got corrupted and the number of entry in the path was not the same
as in the schedule. This was corrupting the memory.
We use the at() instead of [] when accessing the vector in the parsing loop in
getSchedules() and we display a meaningful error message if we
get the exceptiono
@greenscientist greenscientist requested a review from kaligrafy June 11, 2024 18:58
@greenscientist greenscientist merged commit ed0fcf7 into chairemobilite:v2c Jun 11, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants