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

Segfault caused by off by one error in parsing source/destination #5594

Closed
karenzshea opened this issue Nov 6, 2019 · 0 comments
Closed

Comments

@karenzshea
Copy link
Contributor

Sample crashing request (node osrm input):

{ coordinates:
   [ [ -121.94713392, 37.32329383 ],
     [ -121.94532930, 37.32341294 ] ],
  sources: [ 0, 1, 2 ],
  destinations: [ 1 ] }

https://github.com/Project-OSRM/osrm-backend/blob/master/include/nodejs/node_osrm_support.hpp#L1185

if (destination_value > params->coordinates.size())

In the sample request, this check technically passes, and then later in the table plugin, we try to access non-existent position 2 of the input coordinates array and segfault.

The same request but with sources: [ 0, 1, 2, 3 ] returns the error as expected, "Destination indices must be less than or equal to the number of coordinates"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants