From 6c97f01033acfd2332c9cb44f64856206db7304a Mon Sep 17 00:00:00 2001 From: Matthew Fernandez Date: Mon, 27 Jun 2022 18:20:24 -0700 Subject: [PATCH] reallyroutespline: fix unchecked failures on recursion --- lib/pathplan/route.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/pathplan/route.c b/lib/pathplan/route.c index ac81eabd0..163782262 100644 --- a/lib/pathplan/route.c +++ b/lib/pathplan/route.c @@ -142,9 +142,13 @@ static int reallyroutespline(Pedge_t * edges, int edgen, splitv1 = normv(sub(inps[spliti], inps[spliti - 1])); splitv2 = normv(sub(inps[spliti + 1], inps[spliti])); splitv = normv(add(splitv1, splitv2)); - reallyroutespline(edges, edgen, inps, spliti + 1, ev0, splitv); - reallyroutespline(edges, edgen, &inps[spliti], inpn - spliti, splitv, - ev1); + if (reallyroutespline(edges, edgen, inps, spliti + 1, ev0, splitv) < 0) { + return -1; + } + if (reallyroutespline(edges, edgen, &inps[spliti], inpn - spliti, splitv, + ev1) < 0) { + return -1; + } return 0; } -- 2.40.0