commit: d352784c52d82b3d33e53f33c99d8ac5a572ad05
Author: Fabian Groffen <grobian <AT> gentoo <DOT> org>
AuthorDate: Thu Aug 21 19:15:20 2025 +0000
Commit: Fabian Groffen <grobian <AT> gentoo <DOT> org>
CommitDate: Thu Aug 21 19:15:20 2025 +0000
URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=d352784c
libq/xpak: attempt at solving Coverity 548425
Not sure how Coverity thinks dir can be used after being freed, but
maybe initialising the variable to NULL helps here.
Signed-off-by: Fabian Groffen <grobian <AT> gentoo.org>
libq/xpak.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/libq/xpak.c b/libq/xpak.c
index 300d1ff..5434ccc 100644
--- a/libq/xpak.c
+++ b/libq/xpak.c
@@ -340,6 +340,7 @@ xpak_create(
continue;
}
if (S_ISDIR(st.st_mode)) {
+ dir = NULL;
if ((numfiles =
scandir(argv[i], &dir,
filter_hidden, alphasort)) < 0)
{