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 CE20E139085 for ; Thu, 29 Dec 2016 02:26:07 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 3E783E0C0E; Thu, 29 Dec 2016 02:26:07 +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 1E9B6E0C0E for ; Thu, 29 Dec 2016 02:26:02 +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 1013834165D for ; Thu, 29 Dec 2016 02:25:56 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 906BA24FA for ; Thu, 29 Dec 2016 02:25:52 +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: <1482978126.45f8462493056b8ca0634ac0c8942c171deee075.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: 45f8462493056b8ca0634ac0c8942c171deee075 X-VCS-Branch: master Date: Thu, 29 Dec 2016 02:25:52 +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: 1b0084a2-1b8f-4d0c-8bf3-453ef9411d46 X-Archives-Hash: eac38d47d7e72014e6915e5b91e79894 commit: 45f8462493056b8ca0634ac0c8942c171deee075 Author: Mike Frysinger gentoo org> AuthorDate: Thu Dec 29 02:22:06 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Thu Dec 29 02:22:06 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=45f84624 cache: add sanity check on malformed cache files main.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/main.c b/main.c index 33db01a..d124695 100644 --- a/main.c +++ b/main.c @@ -1215,6 +1215,10 @@ cache_read_file_pms(const char *file) next_line(EAPI, PROPERTIES) #undef next_line ptr = strchr(ptr+1, '\n'); + if (ptr == NULL) { + warn("Invalid cache file '%s' - could not find end of cache data", file); + goto err; + } *ptr = '\0'; fclose(f);