commit:     0541387d790d9e9c0e0033492bdbdb5c6d6d2f59
Author:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Sun Feb  6 13:27:22 2022 +0000
Commit:     Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Sun Feb  6 13:27:22 2022 +0000
URL:        https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=0541387d

libq/tree: allocate enough space in tree_clone_meta

Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>

 libq/tree.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libq/tree.c b/libq/tree.c
index db0d2d2..7285cd7 100644
--- a/libq/tree.c
+++ b/libq/tree.c
@@ -1135,7 +1135,7 @@ tree_clone_meta(tree_pkg_meta *m)
        len = sizeof(*ret);
        for (ptr = &m->Q__data; ptr <= &m->Q__last; ptr++)
                if (*ptr != NULL)
-                       len += strlen(*ptr);
+                       len += strlen(*ptr) + 1;
 
        /* malloc and copy */
        ret = xzalloc(len);

Reply via email to