diff -Nru gsl-2.7.1+dfsg/debian/changelog gsl-2.7.1+dfsg/debian/changelog --- gsl-2.7.1+dfsg/debian/changelog 2023-09-12 15:47:39.000000000 +0000 +++ gsl-2.7.1+dfsg/debian/changelog 2023-09-27 13:55:43.000000000 +0000 @@ -1,3 +1,17 @@ +gsl (2.7.1+dfsg-6ubuntu1) mantic; urgency=low + + * Merge from Debian unstable. Remaining changes: + - d/rules: Use -O2 instead of -O3 on ppc64el. + + -- Gianfranco Costamagna Wed, 27 Sep 2023 15:55:43 +0200 + +gsl (2.7.1+dfsg-6) unstable; urgency=medium + + * debian/patches/quantiles_update_from_2.8: Patch from upstream bug + https://savannah.gnu.org/bugs/?59624 addressing CVE-2020-35357 + + -- Dirk Eddelbuettel Tue, 26 Sep 2023 07:03:36 -0500 + gsl (2.7.1+dfsg-5ubuntu1) mantic; urgency=medium * d/rules: Use -O2 instead of -O3 on ppc64el. (LP: #2035228) @@ -975,5 +989,3 @@ * Remove the test-switch program -- Michael J. Booth Sun, 2 Aug 1998 22:56:51 -0400 - - diff -Nru gsl-2.7.1+dfsg/debian/patches/quantiles_update_from_2.8 gsl-2.7.1+dfsg/debian/patches/quantiles_update_from_2.8 --- gsl-2.7.1+dfsg/debian/patches/quantiles_update_from_2.8 1970-01-01 00:00:00.000000000 +0000 +++ gsl-2.7.1+dfsg/debian/patches/quantiles_update_from_2.8 2023-09-26 12:03:36.000000000 +0000 @@ -0,0 +1,88 @@ +Description: Improved upstream version of quantiles function + This is an upstream change in the upcoming, not-yet released GSL 2.8 which + addresses an issue raised in CVE-2020-35357. TODO: Put a short summary on the line above and replace this paragraph + with a longer explanation of this change. Complete the meta-information + with other relevant fields (see below for details). To make it easier, the + information below has been extracted from the changelog. Adjust it or drop + it. + . + gsl (2.7.1+dfsg-6) unstable; urgency=medium + . + * statistics/quantiles_source.c: Apply patch from upstream bug report + https://savannah.gnu.org/bugs/?59624 addressing CVE-2020-35357 +Author: Dirk Eddelbuettel + +--- +The information above should follow the Patch Tagging Guidelines, please +checkout https://dep.debian.net/deps/dep3/ to learn about the format. Here +are templates for supplementary fields that you might want to add: + +Origin: upstream +Bug: https://savannah.gnu.org/bugs/?59624 +Bug-Debian: https://bugs.debian.org/1052655 +Forwarded: no +Applied-Upstream: https://git.savannah.gnu.org/cgit/gsl.git/commit/?id=989a193268b963aa1047814f7f1402084fb7d859 +Last-Update: 2023-09-26 + +--- gsl-2.7.1+dfsg.orig/statistics/quantiles.c ++++ gsl-2.7.1+dfsg/statistics/quantiles.c +@@ -1,5 +1,6 @@ + #include + #include ++#include + + #define BASE_LONG_DOUBLE + #include "templates_on.h" +--- gsl-2.7.1+dfsg.orig/statistics/quantiles_source.c ++++ gsl-2.7.1+dfsg/statistics/quantiles_source.c +@@ -17,29 +17,35 @@ + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +- + double + FUNCTION(gsl_stats,quantile_from_sorted_data) (const BASE sorted_data[], + const size_t stride, + const size_t n, + const double f) + { +- const double index = f * (n - 1) ; +- const size_t lhs = (int)index ; +- const double delta = index - lhs ; +- double result; +- +- if (n == 0) +- return 0.0 ; +- +- if (lhs == n - 1) ++ if ((f < 0.0) || (f > 1.0)) + { +- result = sorted_data[lhs * stride] ; ++ GSL_ERROR_VAL ("invalid quantile fraction", GSL_EDOM, 0.0); + } +- else ++ else + { +- result = (1 - delta) * sorted_data[lhs * stride] + delta * sorted_data[(lhs + 1) * stride] ; +- } ++ const double index = f * (n - 1) ; ++ const size_t lhs = (int)index ; ++ const double delta = index - lhs ; ++ double result; + +- return result ; ++ if (n == 0) ++ return 0.0 ; ++ ++ if (lhs == n - 1) ++ { ++ result = sorted_data[lhs * stride] ; ++ } ++ else ++ { ++ result = (1 - delta) * sorted_data[lhs * stride] + delta * sorted_data[(lhs + 1) * stride] ; ++ } ++ ++ return result ; ++ } + } diff -Nru gsl-2.7.1+dfsg/debian/patches/series gsl-2.7.1+dfsg/debian/patches/series --- gsl-2.7.1+dfsg/debian/patches/series 2023-09-12 09:35:25.000000000 +0000 +++ gsl-2.7.1+dfsg/debian/patches/series 2023-09-26 12:03:36.000000000 +0000 @@ -5,3 +5,4 @@ manual-page-correction ## renamed-delete ## correct-libtool-age-setting +quantiles_update_from_2.8