This is an automated email from the git hooks/post-receive script.

guillem pushed a commit to branch main
in repository dpkg.

View the commit online:
https://git.dpkg.org/cgit/dpkg/dpkg.git/commit/?id=040922cf08e03566a38b1c82ef66f9d01ab30ec3

commit 040922cf08e03566a38b1c82ef66f9d01ab30ec3 (HEAD -> main)
Author: Guillem Jover <[email protected]>
AuthorDate: Wed Jul 10 06:28:38 2024 +0200

    dpkg-realpath: Guarantee varbufs have been allocated
    
    This makes sure all the relevant varbufs are allocated and their buf
    member is not NULL. This is an alternative robustness fix and a
    workaround for commit 0fee7b211d8f31067bb444268860d995a8c1ba1e
    and commit f724d507677674d4386816098bf038aa1567c081.
    
    Changelog: internal
---
 src/realpath/main.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/src/realpath/main.c b/src/realpath/main.c
index b4a2d1d21..bfa2aa2bc 100644
--- a/src/realpath/main.c
+++ b/src/realpath/main.c
@@ -94,6 +94,11 @@ realpath_relative_to(const char *pathname, const char 
*rootdir)
        struct varbuf prefix = VARBUF_INIT;
        int loop = 0;
 
+       varbuf_init(&root, 32);
+       varbuf_init(&src, 32);
+       varbuf_init(&dst, 32);
+       varbuf_init(&result, 32);
+
        varbuf_set_str(&root, rootdir);
        varbuf_set_str(&src, pathname);
        varbuf_set_str(&result, rootdir);

-- 
Dpkg.Org's dpkg

Reply via email to