From 285b238f269ae502810868d6f4dd32c93dc2c060 Mon Sep 17 00:00:00 2001 From: "Daniel J. Hofmann" Date: Wed, 2 Mar 2016 16:11:57 +0100 Subject: [PATCH] Fixes coordinate, source and destination validation by means of backporting #2041 --- include/engine/api/table_parameters.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/engine/api/table_parameters.hpp b/include/engine/api/table_parameters.hpp index 2b748f3b9..fa4cbec10 100644 --- a/include/engine/api/table_parameters.hpp +++ b/include/engine/api/table_parameters.hpp @@ -36,6 +36,10 @@ struct TableParameters : public BaseParameters if (!BaseParameters::IsValid()) return false; + // Distance Table makes only sense with 2+ coordinates and 1+ sources and 1+ destinations + if (coordinates.size() < 2 || sources.size() < 1 || destinations.size() < 1) + return false; + // 1/ The user is able to specify duplicates in srcs and dsts, in that case it's her fault // 2/ len(srcs) and len(dsts) smaller or equal to len(locations)