Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Sep 2020 15:52:18 +0000 (UTC)
From:      Eric van Gyzen <vangyzen@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365051 - head/usr.sbin/pmc
Message-ID:  <202009011552.081FqIXK019435@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: vangyzen
Date: Tue Sep  1 15:52:18 2020
New Revision: 365051
URL: https://svnweb.freebsd.org/changeset/base/365051

Log:
  pmc: Fix freed internal location read
  
  Coverity detected this error.  The fix duplicates the assignment on line 171.
  
  Submitted by:	bret_ketchum@dell.com
  Reported by:	Coverity
  MFC after:	2 weeks
  Sponsored by:	Dell EMC Isilon
  Differential Revision:	https://reviews.freebsd.org/D26227

Modified:
  head/usr.sbin/pmc/cmd_pmc_summary.cc

Modified: head/usr.sbin/pmc/cmd_pmc_summary.cc
==============================================================================
--- head/usr.sbin/pmc/cmd_pmc_summary.cc	Tue Sep  1 15:33:57 2020	(r365050)
+++ head/usr.sbin/pmc/cmd_pmc_summary.cc	Tue Sep  1 15:52:18 2020	(r365051)
@@ -156,7 +156,7 @@ pmc_summary_handler(int logfd, int k, bool do_full)
 			auto rate = ratemap[kv.first];
 			std::cout << "idx: " << kv.first << " name: " << name << " rate: " << rate << std::endl;
 			while (!kv.second.empty()) {
-				auto &val = kv.second.back();
+				auto val = kv.second.back();
 				kv.second.pop_back();
 				std::cout << val.second << ": " << val.first << std::endl;
 			}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202009011552.081FqIXK019435>