From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 886DE59CAF for ; Mon, 4 Apr 2016 15:47:25 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4CB6521C006; Mon, 4 Apr 2016 15:47:22 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id EF7DB21C006 for ; Mon, 4 Apr 2016 15:47:21 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 94D88340B98 for ; Mon, 4 Apr 2016 15:47:20 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 1DFEC75 for ; Mon, 4 Apr 2016 15:47:18 +0000 (UTC) From: "Mike Frysinger" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Mike Frysinger" Message-ID: <1459784740.7c64d59b55c1681a022f7b774590f512d35782c2.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: main.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 7c64d59b55c1681a022f7b774590f512d35782c2 X-VCS-Branch: master Date: Mon, 4 Apr 2016 15:47:18 +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-Archives-Salt: a312a639-10a8-4e14-8cc4-ceacfe0a2f97 X-Archives-Hash: 5c908ac72f50e6f962cdbfcdbf632e4d commit: 7c64d59b55c1681a022f7b774590f512d35782c2 Author: Mike Frysinger gentoo org> AuthorDate: Mon Apr 4 15:45:40 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Mon Apr 4 15:45:40 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7c64d59b repos.conf: fix fallback logic Invert the S_ISREG check so we don't ignore regular files, and avoid leaking the path buffer when we do skip the non-regular files. Reported-by: consus gmx.com main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.c b/main.c index 8e6d4fd..e9e65b4 100644 --- a/main.c +++ b/main.c @@ -507,8 +507,10 @@ static void read_repos_conf(const char *configroot, const char *repos_conf) #endif { struct stat st; - if (stat(sub_conf, &st) || S_ISREG(st.st_mode)) + if (stat(sub_conf, &st) || !S_ISREG(st.st_mode)) { + free(sub_conf); continue; + } } read_one_repos_conf(sub_conf);