From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id A74F7138334 for ; Fri, 3 May 2019 11:45:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id B273EE0821; Fri, 3 May 2019 11:45:25 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 977BDE0821 for ; Fri, 3 May 2019 11:45:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id CCE7A3433B4 for ; Fri, 3 May 2019 11:45:23 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id A83395CB for ; Fri, 3 May 2019 11:45:21 +0000 (UTC) From: "Fabian Groffen" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Fabian Groffen" Message-ID: <1556883880.ab51b5e60db69f6ee6f2513fef7ce12ebc01af92.grobian@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: libq/ X-VCS-Repository: proj/portage-utils X-VCS-Files: libq/cache.c X-VCS-Directories: libq/ X-VCS-Committer: grobian X-VCS-Committer-Name: Fabian Groffen X-VCS-Revision: ab51b5e60db69f6ee6f2513fef7ce12ebc01af92 X-VCS-Branch: master Date: Fri, 3 May 2019 11:45:21 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 9fea68a2-5857-45df-ab59-e1d13516498d X-Archives-Hash: 77bae9e50e9cd8bece06d5dcab9ba953 commit: ab51b5e60db69f6ee6f2513fef7ce12ebc01af92 Author: Fabian Groffen gentoo org> AuthorDate: Fri May 3 11:44:40 2019 +0000 Commit: Fabian Groffen gentoo org> CommitDate: Fri May 3 11:44:40 2019 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=ab51b5e6 libq/cache: fix crash when a category contains a non-directory Bug: https://bugs.gentoo.org/684252 Signed-off-by: Fabian Groffen gentoo.org> libq/cache.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/libq/cache.c b/libq/cache.c index 9993002..0dbf483 100644 --- a/libq/cache.c +++ b/libq/cache.c @@ -160,6 +160,11 @@ cache_next_pkg(cache_cat_ctx *cat_ctx) ctx->ebuilddir_cat_ctx = q_vdb_open_cat(pkgdir, ctx->ebuilddir_pkg_ctx->name); + + /* opening might fail if what we found wasn't a + * directory or something */ + if (ctx->ebuilddir_cat_ctx == NULL) + return NULL; } ret = q_vdb_next_pkg(ctx->ebuilddir_cat_ctx);