diff --git a/mongoose.c b/mongoose.c index 9331760b..b3a2bf95 100644 --- a/mongoose.c +++ b/mongoose.c @@ -6410,6 +6410,7 @@ MG_INTERNAL int mg_uri_to_local_path(struct http_message *hm, } if (ok) { *local_path = lp; + if (u > cp_end) u = cp_end; remainder->p = u; remainder->len = cp_end - u; } else {