From 89b19bb79e9625d0560a2feebe32fad38be5baa3 Mon Sep 17 00:00:00 2001 From: Ivan Polyakov Date: Thu, 24 Nov 2022 00:14:18 +0300 Subject: [PATCH] segfault when checking URL parts fixed by skipping the first (null) part --- c/app.c | 2 +- config.mk | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/c/app.c b/c/app.c index 3bd8482..1efc19a 100644 --- a/c/app.c +++ b/c/app.c @@ -57,7 +57,7 @@ static rpd_route *routes_fabric(rpd_app *app, rpd_req *req) continue; int match = 1; - for (int j = 0; j < route_path->parts_len && match; j++) { + for (int j = 1; j < route_path->parts_len && match; j++) { int cur_part_is_dyn = route_path->parts[i][0] == ':'; if (!cur_part_is_dyn && strcmp(req_path->parts[i], route_path->parts[i])) { match = 0; diff --git a/config.mk b/config.mk index 1ea7d81..e620672 100644 --- a/config.mk +++ b/config.mk @@ -1,4 +1,4 @@ -VERSION=0.4 +VERSION=0.4.1 #arg Installation prefix PREFIX=/usr/local