diff -r 7f0f5c03666a -r e56f9c6f6b8f src/server/util/uri.c --- a/src/server/util/uri.c Wed Jun 08 18:55:59 2022 +0200 +++ b/src/server/util/uri.c Wed Jun 08 19:14:57 2022 +0200 @@ -464,21 +464,19 @@ } done: - int canonLen = 0; if (success) { /* the path looks fine; return the canonicalized form */ - canonLen = (int) (out_ptr - canonPath); + unsigned canonLen = (unsigned) (out_ptr - canonPath); canonPath[canonLen] = '\0'; + if (pcanonlen) *pcanonlen = (int) canonLen; } else { /* error canonicalizing */ pool_free(pool, canonPath); canonPath = NULL; + if (pcanonlen) *pcanonlen = 0; } - if (pcanonlen) - *pcanonlen = canonLen; - return canonPath; }