From 9caa616910f339471f13322872fd5e8104928248 Mon Sep 17 00:00:00 2001 From: Felix Salfelder Date: Tue, 28 Jun 2016 22:58:32 +0100 Subject: [PATCH] tighten check on edges in decomposition tree according to spec, the first vertex number must be the small one. --- td-validate.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/td-validate.cpp b/td-validate.cpp index dce7f73..8cef839 100644 --- a/td-validate.cpp +++ b/td-validate.cpp @@ -418,7 +418,7 @@ void read_decomp_edge(const std::vector& tokens, tree_decomposition unsigned s = pure_stou(tokens[0]); unsigned d = pure_stou(tokens[1]); - if(s < 1 || d < 1 || s > n_decomp || d > n_decomp) { + if(s < 1 || d <= s || d > n_decomp) { throw std::invalid_argument(INV_EDGE); } T.add_edge(s-1, d-1);