From owner-svn-ports-all@freebsd.org Wed Oct 30 22:23:51 2019 Return-Path: Delivered-To: svn-ports-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 58517163640; Wed, 30 Oct 2019 22:23:51 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 473NK31ZpKz4gKx; Wed, 30 Oct 2019 22:23:51 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1AC2C1918B; Wed, 30 Oct 2019 22:23:51 +0000 (UTC) (envelope-from zeising@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x9UMNo2w042869; Wed, 30 Oct 2019 22:23:50 GMT (envelope-from zeising@FreeBSD.org) Received: (from zeising@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x9UMNoSL042867; Wed, 30 Oct 2019 22:23:50 GMT (envelope-from zeising@FreeBSD.org) Message-Id: <201910302223.x9UMNoSL042867@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: zeising set sender to zeising@FreeBSD.org using -f From: Niclas Zeising Date: Wed, 30 Oct 2019 22:23:50 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r516110 - in head/databases/rrdtool: . files X-SVN-Group: ports-head X-SVN-Commit-Author: zeising X-SVN-Commit-Paths: in head/databases/rrdtool: . files X-SVN-Commit-Revision: 516110 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the ports tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Oct 2019 22:23:51 -0000 Author: zeising Date: Wed Oct 30 22:23:50 2019 New Revision: 516110 URL: https://svnweb.freebsd.org/changeset/ports/516110 Log: databases/rrdtool: Fix segfault Add upstream patch to databases/rrdtool to fix segfault when trying to calculate median of all-NaN values PR: 241477 Submitted by: amdmi3 MFH: 2019Q4 Added: head/databases/rrdtool/files/patch-src_rrd__rpncalc.c (contents, props changed) Modified: head/databases/rrdtool/Makefile Modified: head/databases/rrdtool/Makefile ============================================================================== --- head/databases/rrdtool/Makefile Wed Oct 30 22:20:58 2019 (r516109) +++ head/databases/rrdtool/Makefile Wed Oct 30 22:23:50 2019 (r516110) @@ -3,6 +3,7 @@ PORTNAME= rrdtool PORTVERSION= 1.7.2 +PORTREVISION= 1 CATEGORIES= databases graphics MASTER_SITES= http://oss.oetiker.ch/rrdtool/pub/ Added: head/databases/rrdtool/files/patch-src_rrd__rpncalc.c ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/databases/rrdtool/files/patch-src_rrd__rpncalc.c Wed Oct 30 22:23:50 2019 (r516110) @@ -0,0 +1,29 @@ +Fix UB when calculating median of all-NaN values + +Corresponds to upstream commit 1d700bf + +https://github.com/oetiker/rrdtool-1.x/commit/1d700bf3ba13a75b91047e6e979231abd755892b + +--- src/rrd_rpncalc.c.orig 2019-05-27 18:48:09 UTC ++++ src/rrd_rpncalc.c +@@ -1197,15 +1197,16 @@ short rpn_calc( + } + } + ++ /* when goodvals and badvals meet, they might have met on a ++ * NAN, which wouldn't decrease final_elements. so, check ++ * that now. */ ++ if (isnan(*goodvals)) --final_elements; ++ + stptr -= elements; + if (!final_elements) { + /* no non-NAN elements; push NAN */ + rpnstack->s[++stptr] = DNAN; + } else { +- /* when goodvals and badvals meet, they might have met on a +- * NAN, which wouldn't decrease final_elements. so, check +- * that now. */ +- if (isnan(*goodvals)) --final_elements; + /* and finally, take the median of the remaining non-NAN + * elements. */ + qsort(element_ptr, final_elements, sizeof(double),