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 8396A58973 for ; Fri, 29 Jan 2016 05:53:18 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id D23FFE0826; Fri, 29 Jan 2016 05:53:17 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 743D1E0826 for ; Fri, 29 Jan 2016 05:53:17 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id 76517340BE4 for ; Fri, 29 Jan 2016 05:53:16 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id B63388EA for ; Fri, 29 Jan 2016 05:53:12 +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: <1454046730.7aff0263204d80304108dbe4f0061f44ed8f189f.vapier@gentoo> Subject: [gentoo-commits] proj/portage-utils:master commit in: / X-VCS-Repository: proj/portage-utils X-VCS-Files: qlop.c X-VCS-Directories: / X-VCS-Committer: vapier X-VCS-Committer-Name: Mike Frysinger X-VCS-Revision: 7aff0263204d80304108dbe4f0061f44ed8f189f X-VCS-Branch: master Date: Fri, 29 Jan 2016 05:53:12 +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: 12c03f17-e4ac-45b7-b57a-e49f02a9e71e X-Archives-Hash: 6f940227fe13c278e3622f04fc424fbf commit: 7aff0263204d80304108dbe4f0061f44ed8f189f Author: Mike Frysinger gentoo org> AuthorDate: Fri Jan 29 05:52:10 2016 +0000 Commit: Mike Frysinger gentoo org> CommitDate: Fri Jan 29 05:52:10 2016 +0000 URL: https://gitweb.gentoo.org/proj/portage-utils.git/commit/?id=7aff0263 qlop: fix crash w/corrupted log files If a file is truncated/corrupted, make sure we don't read past the end of the valid buffer. URL: https://bugs.gentoo.org/573106 Reported-by: Agostino Sarubbo gentoo.org> qlop.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/qlop.c b/qlop.c index 546c353..bb32474 100644 --- a/qlop.c +++ b/qlop.c @@ -265,6 +265,9 @@ show_emerge_history(char listflag, int argc, char **argv, const char *logfile) continue; *p = 0; q = p + 3; + /* Make sure there's leading white space and not a truncated string. #573106 */ + if (p[1] != ' ' || p[2] != ' ') + continue; t = (time_t) atol(buf);