# HG changeset patch # User Olaf Wintermann # Date 1729703571 -7200 # Node ID 6a466635eace4318dbe1406f39cf0de324976fe3 # Parent 8aa2dc02d9b746cd3c7f4e7a3890fbeb88120fe4 fix missing trailing path separator in href if a resource path is empty diff -r 8aa2dc02d9b7 -r 6a466635eace libidav/utils.c --- a/libidav/utils.c Wed Oct 23 10:32:15 2024 +0200 +++ b/libidav/utils.c Wed Oct 23 19:12:51 2024 +0200 @@ -731,6 +731,11 @@ } char* util_path_to_url(DavSession *sn, const char *path) { + size_t pathlen = path ? strlen(path) : 0; + if(pathlen == 0) { + return strdup(sn->base_url); + } + CxBuffer url; cxBufferInit(&url, NULL, 256, cxDefaultAllocator, CX_BUFFER_FREE_CONTENTS|CX_BUFFER_AUTO_EXTEND); @@ -739,7 +744,7 @@ // remove trailing slash cxBufferSeek(&url, -1, SEEK_CUR); - cxstring p = cx_str(path); + cxstring p = cx_strn(path, pathlen); CxStrtokCtx tkctx = cx_strtok(p, CX_STR("/"), INT_MAX); cxstring node; diff -r 8aa2dc02d9b7 -r 6a466635eace ucx/mempool.c --- a/ucx/mempool.c Wed Oct 23 10:32:15 2024 +0200 +++ b/ucx/mempool.c Wed Oct 23 19:12:51 2024 +0200 @@ -113,6 +113,7 @@ void *p, void *ptr ) { + if(!ptr) return; struct cx_mempool_s *pool = p; struct cx_mempool_memory_s *mem = (struct cx_mempool_memory_s *)