osrm-backend/include/engine/plugins
Daniel J. Hofmann ce1ca1b625 Fixes critical error in table plugin accessing uninitialized memory
Although we check for valid coordinates in the table plugin via
`check_all_coordinates`, we do not check for #srcs > 0 and #dsts > 0.

This would be fine as the grammar parser combines adding coordinates and
setting their `is_source` and `is_destination` property, which makes
adding coordinates without specifying source or destination impossible.

See: route_parameters.cpp, AddSource, AddDestination, and api_grammar.hpp

In contract, the Polyline codepath does not do this! In fact, it only lets
you set coordinates, but not their `is_source` or `is_destination` property.

See: route_parameters.cpp, SetCoordinatesFromGeometry

Therefore, the following queries only set coordinates:

    http 'http://localhost:5000/table?locs=s_hhFg{arEgEfEgEfEgEfEgEfEgEfEgEfEgEfEgEfEgEfE'
    http 'http://localhost:5000/table?locs=_p~iF~ps|U_ulLnnqC_mqNvxq`@'

but fail to specify sources and targets!

The distance table plugin now assumes `is_course` and `is_destination`
is the same size as `coordinates`.

And happily accesses uninitialized memory.
2016-03-03 02:00:39 +01:00
..
distance_table.hpp Fixes critical error in table plugin accessing uninitialized memory 2016-03-03 02:00:39 +01:00
hello_world.hpp Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +01:00
match.hpp Minor typo fix 2016-03-02 15:16:28 +08:00
nearest.hpp Run clang-format 2016-01-08 01:31:57 +01:00
plugin_base.hpp Be kind to the optimizer, pass coordinates by value (just two ints) 2016-01-26 22:57:02 +01:00
tile.hpp Math functions are not constexpr since they have side-effects (setting errno) :( 2016-03-01 23:51:26 +01:00
timestamp.hpp Run clang-format 2016-01-08 01:31:57 +01:00
trip.hpp Refactors Base64 encoding and decoding, it's almost beautiful now 2016-02-12 15:46:24 -08:00
viaroute.hpp modify turn angles and instructions 2016-02-15 20:13:55 +01:00