Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package perl-Statistics-CaseResampling for 
openSUSE:Factory checked in at 2026-11-03 17:59:40
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/perl-Statistics-CaseResampling (Old)
 and      /work/SRC/openSUSE:Factory/.perl-Statistics-CaseResampling.new.1257 
(New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "perl-Statistics-CaseResampling"

Tue Nov  3 17:59:40 2026 rev:4 rq:1394671 version:0.180.0

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/perl-Statistics-CaseResampling/perl-Statistics-CaseResampling.changes
    2025-10-22 12:18:26.084905817 +0200
+++ 
/work/SRC/openSUSE:Factory/.perl-Statistics-CaseResampling.new.1257/perl-Statistics-CaseResampling.changes
  2026-11-03 18:04:34.651038480 +0100
@@ -1,0 +2,25 @@
+Sun Oct 11 11:27:34 UTC 2026 - Tina Müller <[email protected]>
+
+- updated to 0.180.0 (0.18)
+   see /usr/share/doc/packages/perl-Statistics-CaseResampling/Changes
+
+  0.18  Sun Oct 11 10:00:00 2026
+    - Fix wild stack pointer deallocation (SIGABRT free() invalid pointer)
+      when passing empty arrays to resampling/statistical functions (SCR-01).
+    - Prevent use-after-free and double-free under ithreads by adding CLONE
+      and CLONE_SKIP handlers for the PRNG state (SCR-02).
+    - Fix out-of-bounds indexing in first_quartile and third_quartile for
+      small samples (SCR-03).
+    - Clamp confidence limit indices to valid sample bounds on extreme
+      confidence levels (SCR-04).
+    - Validate resample run counts (runs >= 1 && runs <= 100000000) (SCR-05).
+    - Fix memory leak on invalid kth selection in select_kth (SCR-06).
+    - Guard sample and population standard deviation calculations against
+      division by zero on small sample sizes (SCR-07).
+    - Use Perl memory allocator (Newx/Safefree) consistently in
+      median_absolute_deviation (SCR-08).
+    - Harden U32ArrayPtr buffer allocation and size validation (SCR-09).
+    - Add comprehensive regression test suite in t/03_security.t.
+    - Update author contact details to [email protected].
+
+-------------------------------------------------------------------

Old:
----
  Statistics-CaseResampling-0.17.tar.gz

New:
----
  Statistics-CaseResampling-0.18.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ perl-Statistics-CaseResampling.spec ++++++
--- /var/tmp/diff_new_pack.vGDedy/_old  2026-11-03 18:04:35.610078787 +0100
+++ /var/tmp/diff_new_pack.vGDedy/_new  2026-11-03 18:04:35.612078871 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package perl-Statistics-CaseResampling
 #
-# Copyright (c) 2025 SUSE LLC and contributors
+# Copyright (c) 2026 SUSE LLC and contributors
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -18,10 +18,10 @@
 
 %define cpan_name Statistics-CaseResampling
 Name:           perl-Statistics-CaseResampling
-Version:        0.170.0
+Version:        0.180.0
 Release:        0
-# 0.17 -> normalize -> 0.170.0
-%define cpan_version 0.17
+# 0.18 -> normalize -> 0.180.0
+%define cpan_version 0.18
 License:        Artistic-1.0 OR GPL-1.0-or-later
 Summary:        Efficient resampling and calculation of medians with 
confidence intervals
 URL:            https://metacpan.org/release/%{cpan_name}

++++++ Statistics-CaseResampling-0.17.tar.gz -> 
Statistics-CaseResampling-0.18.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/CaseResampling.xs 
new/Statistics-CaseResampling-0.18/CaseResampling.xs
--- old/Statistics-CaseResampling-0.17/CaseResampling.xs        2025-07-17 
16:27:05.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/CaseResampling.xs        2026-10-11 
10:46:49.000000000 +0200
@@ -15,7 +15,11 @@
 void*
 U32ArrayPtr (pTHX_ int n)
 {
-  SV * sv = sv_2mortal( NEWSV( 0, n*sizeof(U32) ) );
+  SV * sv;
+  if (n <= 0 || n > 10000000)
+    croak("Invalid array size for U32ArrayPtr");
+  sv = sv_2mortal( NEWSV( 0, n*sizeof(U32) ) );
+  SvGROW(sv, n*sizeof(U32));
   return SvPVX(sv);
 }
 
@@ -26,6 +30,8 @@
   SV** elem;
   double sum;
   n = av_len(sample)+1;
+  if (n <= 0)
+    return 0.;
   sum = 0.;
   for (i = 0; i < n; ++i) {
     if (NULL == (elem = av_fetch(sample, i, 0))) {
@@ -44,6 +50,8 @@
   SV** elem;
   double sum;
   n = av_len(sample)+1;
+  if (n <= 0)
+    return 0.;
   sum = 0.;
   for (i = 0; i < n; ++i) {
     if (NULL == (elem = av_fetch(sample, i, 0))) {
@@ -62,16 +70,20 @@
   double* ary;
   SV** elem;
   I32 i;
+  *out = NULL;
   thisN = av_len(in)+1;
-  *n = thisN;
-  if (thisN == 0)
+  if (thisN <= 0) {
+    *n = 0;
     return;
+  }
+  *n = thisN;
 
   Newx(ary, thisN, double);
   *out = ary;
   for (i = 0; i < thisN; ++i) {
     if (NULL == (elem = av_fetch(in, i, 0))) {
       Safefree(ary);
+      *out = NULL;
       croak("Could not fetch element from array");
     }
     else
@@ -126,8 +138,8 @@
     AV* sample
   PREINIT:
     I32 nelem;
-    double* csample;
-    double* destsample;
+    double* csample = NULL;
+    double* destsample = NULL;
     struct mt* rnd;
   CODE:
     rnd = get_rnd(aTHX);
@@ -152,10 +164,12 @@
   PREINIT:
     I32 nelem;
     I32 i_run;
-    double* csample;
-    double* destsample;
+    double* csample = NULL;
+    double* destsample = NULL;
     struct mt* rnd;
   CODE:
+    if (runs < 1 || runs > 100000000)
+      croak("Number of resample runs must be between 1 and 100000000");
     rnd = get_rnd(aTHX);
     avToCAry(aTHX_ sample, &csample, &nelem);
     RETVAL = newAV();
@@ -180,10 +194,12 @@
   PREINIT:
     I32 nelem;
     I32 i_run;
-    double* csample;
-    double* destsample;
+    double* csample = NULL;
+    double* destsample = NULL;
     struct mt* rnd;
   CODE:
+    if (runs < 1 || runs > 100000000)
+      croak("Number of resample runs must be between 1 and 100000000");
     rnd = get_rnd(aTHX);
     avToCAry(aTHX_ sample, &csample, &nelem);
     RETVAL = newAV();
@@ -206,7 +222,7 @@
     AV* sample
   PREINIT:
     I32 nelem;
-    double* csample;
+    double* csample = NULL;
   CODE:
     avToCAry(aTHX_ sample, &csample, &nelem);
     if (nelem == 0)
@@ -221,24 +237,24 @@
     AV* sample
   PREINIT:
     I32 nelem;
-    double* csample;
+    double* csample = NULL;
   CODE:
     avToCAry(aTHX_ sample, &csample, &nelem);
     if (nelem == 0)
       RETVAL = 0.;
     else {
-      unsigned int i;
+      I32 i;
       double* absdev;
 
       const double median = cs_median(csample, nelem);
       /* in principle, I think one could write an algorithm
        * that doesn't require mallocing the second array by inlining an
        * O(n) median that visits each element only once? */
-      absdev = (double*)malloc(nelem * sizeof(double));
+      Newx(absdev, nelem, double);
       for (i = 0; i < nelem; ++i)
         absdev[i] = fabs(csample[i] - median);
       RETVAL = cs_median(absdev, nelem);
-      free(absdev);
+      Safefree(absdev);
     }
     Safefree(csample);
   OUTPUT: RETVAL
@@ -249,7 +265,7 @@
     AV* sample
   PREINIT:
     I32 nelem;
-    double* csample;
+    double* csample = NULL;
   CODE:
     avToCAry(aTHX_ sample, &csample, &nelem);
     if (nelem == 0)
@@ -265,7 +281,7 @@
     AV* sample
   PREINIT:
     I32 nelem;
-    double* csample;
+    double* csample = NULL;
   CODE:
     avToCAry(aTHX_ sample, &csample, &nelem);
     if (nelem == 0)
@@ -288,9 +304,14 @@
 sample_standard_deviation(mean, sample)
     SV* mean
     AV* sample
+  PREINIT:
+    I32 n;
   CODE:
+    n = av_len(sample)+1;
+    if (n < 2)
+      croak("Sample standard deviation requires at least 2 data points");
     RETVAL =  cs_sum_deviation_squared_av(aTHX_ SvNV(mean), sample);
-    RETVAL = pow( RETVAL / av_len(sample), 0.5 ); /* av_len() is N-1! */
+    RETVAL = pow( RETVAL / (double)(n - 1), 0.5 );
   OUTPUT: RETVAL
 
 
@@ -298,9 +319,14 @@
 population_standard_deviation(mean, sample)
     SV* mean
     AV* sample
+  PREINIT:
+    I32 n;
   CODE:
+    n = av_len(sample)+1;
+    if (n < 1)
+      croak("Population standard deviation requires at least 1 data point");
     RETVAL =  cs_sum_deviation_squared_av(aTHX_ SvNV(mean), sample);
-    RETVAL = pow( RETVAL / (av_len(sample)+1), 0.5 ); /* av_len() is N-1! */
+    RETVAL = pow( RETVAL / (double)n, 0.5 );
   OUTPUT: RETVAL
 
 
@@ -310,10 +336,11 @@
     I32 kth
   PREINIT:
     I32 nelem;
-    double* csample;
+    double* csample = NULL;
   CODE:
     avToCAry(aTHX_ sample, &csample, &nelem);
     if (kth < 1 || kth > nelem) {
+      Safefree(csample);
       croak("Can't select %ith smallest element from a list of %i elements", 
kth, nelem);
     }
     RETVAL = cs_select(csample, nelem, kth-1);
@@ -328,7 +355,8 @@
   PREINIT:
     /* "confidence" is 1-alpha */
     I32 runs, nelem, i_run;
-    double *csample, *destsample, *medians;
+    I32 lower_idx, upper_idx;
+    double *csample = NULL, *destsample = NULL, *medians = NULL;
     struct mt* rnd;
     double median   = 0.;
     double lower_ci = 0.;
@@ -339,8 +367,12 @@
   PPCODE:
     if (items == 2)
       runs = 1000;
-    else if (items == 3)
-      runs = SvUV(ST(2));
+    else if (items == 3) {
+      IV r = SvIV(ST(2));
+      if (r < 1 || r > 100000000)
+        croak("Number of resample runs must be between 1 and 100000000");
+      runs = (I32)r;
+    }
     else {
       croak("Usage: ($lower, $median, $upper) = 
median_confidence_limits(\\@sample, $confidence, [$nruns]);");
     }
@@ -361,8 +393,14 @@
       /* lower = t - (t*_((R+1)*(1-alpha)) - t)
        * upper = t - (t*_((R+1)*alpha) - t)
        */
-      lower_ci = 2.*median - cs_select( medians, runs, 
(I32)((runs+1.)*(1.-alpha)) );
-      upper_ci = 2.*median - cs_select( medians, runs, (I32)((runs+1.)*alpha) 
);
+      lower_idx = (I32)((runs+1.)*(1.-alpha));
+      upper_idx = (I32)((runs+1.)*alpha);
+      if (lower_idx >= runs) lower_idx = runs - 1;
+      if (lower_idx < 0)     lower_idx = 0;
+      if (upper_idx >= runs) upper_idx = runs - 1;
+      if (upper_idx < 0)     upper_idx = 0;
+      lower_ci = 2.*median - cs_select( medians, runs, (U32)lower_idx );
+      upper_ci = 2.*median - cs_select( medians, runs, (U32)upper_idx );
       Safefree(medians);
     }
     Safefree(csample);
@@ -380,7 +418,8 @@
   PREINIT:
     /* "confidence" is 1-alpha */
     I32 nelem;
-    double *cstatistics;
+    I32 lower_idx, upper_idx;
+    double *cstatistics = NULL;
     double lower_ci = 0.;
     double upper_ci = 0.;
     double alpha;
@@ -395,8 +434,14 @@
       /* lower = t - (t*_((R+1)*(1-alpha)) - t)
        * upper = t - (t*_((R+1)*alpha) - t)
        */
-      lower_ci = 2.*statistic - cs_select( cstatistics, nelem, 
(I32)((nelem+1.)*(1.-alpha)) );
-      upper_ci = 2.*statistic - cs_select( cstatistics, nelem, 
(I32)((nelem+1.)*alpha) );
+      lower_idx = (I32)((nelem+1.)*(1.-alpha));
+      upper_idx = (I32)((nelem+1.)*alpha);
+      if (lower_idx >= nelem) lower_idx = nelem - 1;
+      if (lower_idx < 0)      lower_idx = 0;
+      if (upper_idx >= nelem) upper_idx = nelem - 1;
+      if (upper_idx < 0)      upper_idx = 0;
+      lower_ci = 2.*statistic - cs_select( cstatistics, nelem, (U32)lower_idx 
);
+      upper_ci = 2.*statistic - cs_select( cstatistics, nelem, (U32)upper_idx 
);
     }
     Safefree(cstatistics);
     EXTEND(SP, 3);
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/Changes 
new/Statistics-CaseResampling-0.18/Changes
--- old/Statistics-CaseResampling-0.17/Changes  2025-07-17 16:29:29.000000000 
+0200
+++ new/Statistics-CaseResampling-0.18/Changes  2026-10-11 10:53:20.000000000 
+0200
@@ -1,5 +1,24 @@
 Revision history for Perl extension Statistics::CaseResampling.
 
+0.18  Sun Oct 11 10:00:00 2026
+  - Fix wild stack pointer deallocation (SIGABRT free() invalid pointer)
+    when passing empty arrays to resampling/statistical functions (SCR-01).
+  - Prevent use-after-free and double-free under ithreads by adding CLONE
+    and CLONE_SKIP handlers for the PRNG state (SCR-02).
+  - Fix out-of-bounds indexing in first_quartile and third_quartile for
+    small samples (SCR-03).
+  - Clamp confidence limit indices to valid sample bounds on extreme
+    confidence levels (SCR-04).
+  - Validate resample run counts (runs >= 1 && runs <= 100000000) (SCR-05).
+  - Fix memory leak on invalid kth selection in select_kth (SCR-06).
+  - Guard sample and population standard deviation calculations against
+    division by zero on small sample sizes (SCR-07).
+  - Use Perl memory allocator (Newx/Safefree) consistently in
+    median_absolute_deviation (SCR-08).
+  - Harden U32ArrayPtr buffer allocation and size validation (SCR-09).
+  - Add comprehensive regression test suite in t/03_security.t.
+  - Update author contact details to [email protected].
+
 0.17  Thu Jul 17 20:00:00 2025
   - Include a fallback #ifndef for what appears to be an edge case github
     actions issue.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/MANIFEST 
new/Statistics-CaseResampling-0.18/MANIFEST
--- old/Statistics-CaseResampling-0.17/MANIFEST 2025-07-17 16:29:37.000000000 
+0200
+++ new/Statistics-CaseResampling-0.18/MANIFEST 2026-10-11 11:01:56.000000000 
+0200
@@ -6,14 +6,13 @@
 Makefile.PL
 MANIFEST                       This list of files
 mt.h
-MYMETA.json
-MYMETA.yml
 ppport.h
 RdGen.xs.inc
 README
 stats.h
 t/01all.t
 t/02stats.t
+t/03_security.t
 typemap
 META.yml                                 Module YAML meta-data (added by 
MakeMaker)
 META.json                                Module JSON meta-data (added by 
MakeMaker)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/META.json 
new/Statistics-CaseResampling-0.18/META.json
--- old/Statistics-CaseResampling-0.17/META.json        2025-07-17 
16:29:37.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/META.json        2026-10-11 
11:01:56.000000000 +0200
@@ -1,7 +1,7 @@
 {
    "abstract" : "Efficient resampling and calculation of medians with 
confidence intervals",
    "author" : [
-      "Steffen Mueller <[email protected]>"
+      "Steffen Mueller <[email protected]>"
    ],
    "dynamic_config" : 1,
    "generated_by" : "ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter 
version 2.150010",
@@ -37,6 +37,6 @@
       }
    },
    "release_status" : "stable",
-   "version" : "0.17",
+   "version" : "0.18",
    "x_serialization_backend" : "JSON::PP version 4.16"
 }
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/META.yml 
new/Statistics-CaseResampling-0.18/META.yml
--- old/Statistics-CaseResampling-0.17/META.yml 2025-07-17 16:29:37.000000000 
+0200
+++ new/Statistics-CaseResampling-0.18/META.yml 2026-10-11 11:01:56.000000000 
+0200
@@ -1,7 +1,7 @@
 ---
 abstract: 'Efficient resampling and calculation of medians with confidence 
intervals'
 author:
-  - 'Steffen Mueller <[email protected]>'
+  - 'Steffen Mueller <[email protected]>'
 build_requires:
   ExtUtils::MakeMaker: '0'
 configure_requires:
@@ -19,5 +19,5 @@
     - inc
 requires:
   List::Util: '0'
-version: '0.17'
+version: '0.18'
 x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/MYMETA.json 
new/Statistics-CaseResampling-0.18/MYMETA.json
--- old/Statistics-CaseResampling-0.17/MYMETA.json      2025-07-17 
16:29:35.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/MYMETA.json      1970-01-01 
01:00:00.000000000 +0100
@@ -1,42 +0,0 @@
-{
-   "abstract" : "Efficient resampling and calculation of medians with 
confidence intervals",
-   "author" : [
-      "Steffen Mueller <[email protected]>"
-   ],
-   "dynamic_config" : 0,
-   "generated_by" : "ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter 
version 2.150010",
-   "license" : [
-      "unknown"
-   ],
-   "meta-spec" : {
-      "url" : "http://search.cpan.org/perldoc?CPAN::Meta::Spec";,
-      "version" : 2
-   },
-   "name" : "Statistics-CaseResampling",
-   "no_index" : {
-      "directory" : [
-         "t",
-         "inc"
-      ]
-   },
-   "prereqs" : {
-      "build" : {
-         "requires" : {
-            "ExtUtils::MakeMaker" : "0"
-         }
-      },
-      "configure" : {
-         "requires" : {
-            "ExtUtils::MakeMaker" : "0"
-         }
-      },
-      "runtime" : {
-         "requires" : {
-            "List::Util" : "0"
-         }
-      }
-   },
-   "release_status" : "stable",
-   "version" : "0.17",
-   "x_serialization_backend" : "JSON::PP version 4.16"
-}
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/MYMETA.yml 
new/Statistics-CaseResampling-0.18/MYMETA.yml
--- old/Statistics-CaseResampling-0.17/MYMETA.yml       2025-07-17 
16:29:35.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/MYMETA.yml       1970-01-01 
01:00:00.000000000 +0100
@@ -1,23 +0,0 @@
----
-abstract: 'Efficient resampling and calculation of medians with confidence 
intervals'
-author:
-  - 'Steffen Mueller <[email protected]>'
-build_requires:
-  ExtUtils::MakeMaker: '0'
-configure_requires:
-  ExtUtils::MakeMaker: '0'
-dynamic_config: 0
-generated_by: 'ExtUtils::MakeMaker version 7.70, CPAN::Meta::Converter version 
2.150010'
-license: unknown
-meta-spec:
-  url: http://module-build.sourceforge.net/META-spec-v1.4.html
-  version: '1.4'
-name: Statistics-CaseResampling
-no_index:
-  directory:
-    - t
-    - inc
-requires:
-  List::Util: '0'
-version: '0.17'
-x_serialization_backend: 'CPAN::Meta::YAML version 0.018'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/Makefile.PL 
new/Statistics-CaseResampling-0.18/Makefile.PL
--- old/Statistics-CaseResampling-0.17/Makefile.PL      2025-07-17 
16:27:05.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/Makefile.PL      2026-10-11 
10:52:47.000000000 +0200
@@ -10,7 +10,7 @@
     }, # e.g., Module::Name => 1.1
     ($] >= 5.005 ?     ## Add these new keywords supported since 5.005
       (ABSTRACT_FROM  => 'lib/Statistics/CaseResampling.pm', # retrieve 
abstract from module
-       AUTHOR         => 'Steffen Mueller <[email protected]>') : ()),
+       AUTHOR         => 'Steffen Mueller <[email protected]>') : ()),
     LIBS              => [''], # e.g., '-lm'
     #DEFINE            => '-O2', # e.g., '-DHAVE_SOMETHING'
     INC               => '-I.', # e.g., '-I. -I/usr/include/other'
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/README 
new/Statistics-CaseResampling-0.18/README
--- old/Statistics-CaseResampling-0.17/README   2025-07-17 16:27:05.000000000 
+0200
+++ new/Statistics-CaseResampling-0.18/README   2026-10-11 10:52:53.000000000 
+0200
@@ -217,7 +217,7 @@
       http://homepages.physik.uni-muenchen.de/~Winitzki/erf-approx.pdf
 
 AUTHOR
-    Steffen Mueller, <[email protected]>
+    Steffen Mueller, <[email protected]>
 
 COPYRIGHT AND LICENSE
     Copyright (C) 2010, 2011, 2012 by Steffen Mueller
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/RdGen.xs.inc 
new/Statistics-CaseResampling-0.18/RdGen.xs.inc
--- old/Statistics-CaseResampling-0.17/RdGen.xs.inc     2025-07-17 
16:27:05.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/RdGen.xs.inc     2026-10-11 
10:44:33.000000000 +0200
@@ -2,6 +2,13 @@
 MODULE = Statistics::CaseResampling            PACKAGE = 
Statistics::CaseResampling::RdGen PREFIX=mt_
 PROTOTYPES: DISABLE
 
+int
+mt_CLONE_SKIP(...)
+  CODE:
+    RETVAL = 1;
+  OUTPUT:
+    RETVAL
+
 Statistics::CaseResampling::RdGen
 mt_setup(seed)
   U32     seed
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/_mt.c 
new/Statistics-CaseResampling-0.18/_mt.c
--- old/Statistics-CaseResampling-0.17/_mt.c    2025-07-17 16:27:05.000000000 
+0200
+++ new/Statistics-CaseResampling-0.18/_mt.c    2026-10-11 10:46:20.000000000 
+0200
@@ -70,7 +70,8 @@
 
 void mt_free(struct mt *self)
 {
-    free(self);
+    if (self)
+        free(self);
 }
 
 /* Returns a pseudorandom number which is uniformly distributed in [0,1) */
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/_stats.c 
new/Statistics-CaseResampling-0.18/_stats.c
--- old/Statistics-CaseResampling-0.17/_stats.c 2025-07-17 16:28:28.000000000 
+0200
+++ new/Statistics-CaseResampling-0.18/_stats.c 2026-10-11 10:45:14.000000000 
+0200
@@ -12,6 +12,11 @@
   U32 i, ir, j, l, mid;
   double a, tmp;
 
+  if (n <= 0)
+    return 0.;
+  if (k >= (U32)n)
+    k = (U32)(n - 1);
+
   l = 0;
   ir = n-1;
   while(1) {
@@ -56,7 +61,10 @@
 double
 cs_median(double* sample, I32 n)
 {
-  U32 k = n/2 - !(n & 1);
+  U32 k;
+  if (n <= 0)
+    return 0.;
+  k = n/2 - !(n & 1);
   return cs_select(sample, n, k);
 }
 
@@ -64,7 +72,12 @@
 double
 cs_first_quartile(double* sample, I32 n)
 {
-  U32 k = (U32)((n/4) + 1);
+  U32 k;
+  if (n <= 0)
+    return 0.;
+  k = (U32)(n / 4);
+  if (k >= (U32)n)
+    k = (U32)(n - 1);
   return cs_select(sample, n, k);
 }
 
@@ -72,7 +85,12 @@
 double
 cs_third_quartile(double* sample, I32 n)
 {
-  U32 k = (U32)((n*3/4) + 1);
+  U32 k;
+  if (n <= 0)
+    return 0.;
+  k = (U32)(n * 3 / 4);
+  if (k >= (U32)n)
+    k = (U32)(n - 1);
   return cs_select(sample, n, k);
 }
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' 
old/Statistics-CaseResampling-0.17/lib/Statistics/CaseResampling.pm 
new/Statistics-CaseResampling-0.18/lib/Statistics/CaseResampling.pm
--- old/Statistics-CaseResampling-0.17/lib/Statistics/CaseResampling.pm 
2025-07-17 16:28:47.000000000 +0200
+++ new/Statistics-CaseResampling-0.18/lib/Statistics/CaseResampling.pm 
2026-10-11 10:52:50.000000000 +0200
@@ -5,7 +5,7 @@
 
 require Exporter;
 
-our $VERSION = '0.17';
+our $VERSION = '0.18';
 
 our @ISA = qw(Exporter);
 our @EXPORT_OK = qw(
@@ -35,6 +35,12 @@
 
 our $Rnd = Statistics::CaseResampling::RdGen::setup(rand());
 
+sub CLONE {
+  $Rnd = Statistics::CaseResampling::RdGen::setup(rand());
+}
+
+sub Statistics::CaseResampling::RdGen::CLONE_SKIP { 1 }
+
 
 1;
 __END__
@@ -308,7 +314,7 @@
 
 =head1 AUTHOR
 
-Steffen Mueller, E<lt>[email protected]<gt>
+Steffen Mueller, E<lt>[email protected]<gt>
 
 Daniel Dragan, E<lt>[email protected]<gt>, who supplied MSVC compatibility
 patches.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/Statistics-CaseResampling-0.17/t/03_security.t 
new/Statistics-CaseResampling-0.18/t/03_security.t
--- old/Statistics-CaseResampling-0.17/t/03_security.t  1970-01-01 
01:00:00.000000000 +0100
+++ new/Statistics-CaseResampling-0.18/t/03_security.t  2026-10-11 
10:47:02.000000000 +0200
@@ -0,0 +1,165 @@
+use strict;
+use warnings;
+use Test::More;
+use Statistics::CaseResampling ':all';
+
+# SCR-01: Empty array handling without wild pointer deallocation / crashes
+{
+  my $r = resample([]);
+  is_deeply($r, [], 'resample([]) returns empty array without crash');
+
+  my $rm = resample_medians([], 10);
+  is_deeply($rm, [], 'resample_medians([], 10) returns empty array without 
crash');
+
+  my $rme = resample_means([], 10);
+  is_deeply($rme, [], 'resample_means([], 10) returns empty array without 
crash');
+
+  is(median([]), 0, 'median([]) returns 0 without crash');
+  is(median_absolute_deviation([]), 0, 'median_absolute_deviation([]) returns 
0 without crash');
+  is(first_quartile([]), 0, 'first_quartile([]) returns 0 without crash');
+  is(third_quartile([]), 0, 'third_quartile([]) returns 0 without crash');
+
+  my ($l, $med, $u) = median_simple_confidence_limits([], 0.95);
+  is($l, 0, 'median_simple_confidence_limits([]) lower is 0');
+  is($med, 0, 'median_simple_confidence_limits([]) median is 0');
+  is($u, 0, 'median_simple_confidence_limits([]) upper is 0');
+
+  my ($l2, $st, $u2) = simple_confidence_limits_from_samples(0, [], 0.95);
+  is($l2, 0, 'simple_confidence_limits_from_samples([]) lower is 0');
+  is($st, 0, 'simple_confidence_limits_from_samples([]) stat is 0');
+  is($u2, 0, 'simple_confidence_limits_from_samples([]) upper is 0');
+}
+
+# SCR-02: ithreads use-after-free and double-free protection
+{
+  use Config;
+  SKIP: {
+    skip 'This Perl does not support ithreads', 4 unless $Config{useithreads};
+    require threads;
+
+    my $t = threads->create(sub {
+      my $sample = [1..10];
+      my $res = resample($sample);
+      return scalar(@$res);
+    });
+    my $res = $t->join();
+    is($res, 10, 'thread executed resample successfully');
+
+    my $main_res = resample([1..10]);
+    is(scalar(@$main_res), 10, 'main thread executed resample after thread 
join without double-free');
+
+    # Also test an explicit generator object under threads
+    my $gen = Statistics::CaseResampling::RdGen::setup(12345);
+    my $t2 = threads->create(sub {
+      return 1;
+    });
+    $t2->join();
+    ok(1, 'thread with explicit generator joined without double-free');
+    my $val = $gen->genrand();
+    ok($val >= 0 && $val < 1, 'explicit generator still valid in parent 
thread');
+  }
+}
+
+# SCR-03: Quartile calculations for small arrays without out-of-bounds reads
+{
+  # n = 1
+  is(first_quartile([10]), 10, 'first_quartile([10]) == 10');
+  is(third_quartile([10]), 10, 'third_quartile([10]) == 10');
+  is(median([10]), 10, 'median([10]) == 10');
+
+  # n = 2
+  is(first_quartile([10, 20]), 10, 'first_quartile([10, 20]) == 10');
+  is(third_quartile([10, 20]), 20, 'third_quartile([10, 20]) == 20 (not OOB 
heap garbage)');
+  is(median([10, 20]), 10, 'median([10, 20]) == 10');
+
+  # n = 3
+  is(first_quartile([10, 20, 30]), 10, 'first_quartile([10, 20, 30]) == 10');
+  is(third_quartile([10, 20, 30]), 30, 'third_quartile([10, 20, 30]) == 30');
+  is(median([10, 20, 30]), 20, 'median([10, 20, 30]) == 20');
+
+  # n = 4
+  is(first_quartile([10, 20, 30, 40]), 20, 'first_quartile([10, 20, 30, 40]) 
== 20');
+  is(third_quartile([10, 20, 30, 40]), 40, 'third_quartile([10, 20, 30, 40]) 
== 40');
+  is(median([10, 20, 30, 40]), 20, 'median([10, 20, 30, 40]) == 20');
+}
+
+# SCR-04: Confidence limits bounds clamping on extreme confidence levels
+{
+  # High confidence
+  my ($l1, $m1, $u1) = median_simple_confidence_limits([1..50], 0.9999, 10);
+  ok(defined $l1 && defined $m1 && defined $u1, 
'median_simple_confidence_limits with 0.9999 conf returned values');
+
+  my ($l2, $m2, $u2) = simple_confidence_limits_from_samples(5, [1..5], 
0.9999);
+  ok(defined $l2 && defined $m2 && defined $u2, 
'simple_confidence_limits_from_samples with 0.9999 conf returned values');
+
+  # Low confidence
+  my ($l3, $m3, $u3) = median_simple_confidence_limits([1..50], 0.0001, 10);
+  ok(defined $l3 && defined $m3 && defined $u3, 
'median_simple_confidence_limits with 0.0001 conf returned values');
+
+  my ($l4, $m4, $u4) = simple_confidence_limits_from_samples(5, [1..5], 
0.0001);
+  ok(defined $l4 && defined $m4 && defined $u4, 
'simple_confidence_limits_from_samples with 0.0001 conf returned values');
+}
+
+# SCR-05: Validation of resample run counts
+{
+  eval { resample_medians([1..5], 0) };
+  like($@, qr/Number of resample runs must be between 1 and 100000000/, 
'resample_medians rejects runs = 0');
+
+  eval { resample_medians([1..5], -1) };
+  like($@, qr/Number of resample runs must be between 1 and 100000000/, 
'resample_medians rejects runs = -1');
+
+  eval { resample_means([1..5], 0) };
+  like($@, qr/Number of resample runs must be between 1 and 100000000/, 
'resample_means rejects runs = 0');
+
+  eval { resample_means([1..5], -1) };
+  like($@, qr/Number of resample runs must be between 1 and 100000000/, 
'resample_means rejects runs = -1');
+
+  eval { median_simple_confidence_limits([1..5], 0.95, 0) };
+  like($@, qr/Number of resample runs must be between 1 and 100000000/, 
'median_simple_confidence_limits rejects runs = 0');
+
+  eval { median_simple_confidence_limits([1..5], 0.95, -1) };
+  like($@, qr/Number of resample runs must be between 1 and 100000000/, 
'median_simple_confidence_limits rejects runs = -1');
+}
+
+# SCR-06: select_kth error handling
+{
+  eval { select_kth([1..5], 0) };
+  like($@, qr/Can't select 0th smallest element/, 'select_kth rejects kth = 
0');
+
+  eval { select_kth([1..5], 6) };
+  like($@, qr/Can't select 6th smallest element/, 'select_kth rejects kth > 
nelem');
+
+  eval { select_kth([], 1) };
+  like($@, qr/Can't select 1th smallest element/, 'select_kth rejects kth on 
empty array');
+}
+
+# SCR-07: Standard deviation edge case guards & mean
+{
+  eval { sample_standard_deviation(10, []) };
+  like($@, qr/Sample standard deviation requires at least 2 data points/, 
'sample_standard_deviation rejects empty array');
+
+  eval { sample_standard_deviation(10, [10]) };
+  like($@, qr/Sample standard deviation requires at least 2 data points/, 
'sample_standard_deviation rejects single-element array');
+
+  eval { population_standard_deviation(10, []) };
+  like($@, qr/Population standard deviation requires at least 1 data point/, 
'population_standard_deviation rejects empty array');
+
+  is(population_standard_deviation(10, [10]), 0, 
'population_standard_deviation([10]) == 0');
+  is(mean([]), 0, 'mean([]) == 0 without division by zero');
+}
+
+# SCR-08: median_absolute_deviation allocator safety
+{
+  is(median_absolute_deviation([5]), 0, 'MAD of single element is 0');
+  is(median_absolute_deviation([1, 2, 3, 4, 5]), 1, 'MAD of [1..5] is 1');
+}
+
+# SCR-09: RdGen setup_array and buffer handling
+{
+  my $rnd = Statistics::CaseResampling::RdGen::setup_array(1, 2, 3, 4, 5);
+  ok(defined $rnd, 'setup_array creates RdGen object');
+  my $val = $rnd->genrand();
+  ok($val >= 0 && $val < 1, 'genrand produces random number in [0, 1)');
+}
+
+done_testing();

++++++ _scmsync.obsinfo ++++++
--- /var/tmp/diff_new_pack.vGDedy/_old  2026-11-03 18:04:35.786086185 +0100
+++ /var/tmp/diff_new_pack.vGDedy/_new  2026-11-03 18:04:35.791086395 +0100
@@ -1,6 +1,6 @@
-mtime: 1759934255
-commit: 961c32abd64d9c574fb7cbabcc661d34053efef2be5b3ed61cb43ac459e0f341
-url: https://src.opensuse.org/perl/perl-Statistics-CaseResampling.git
-revision: 961c32abd64d9c574fb7cbabcc661d34053efef2be5b3ed61cb43ac459e0f341
+mtime: 1791718054
+commit: 7aeca42ec73bc1e4877aaa17db83fa9f45f2193b49df18950d748778af4fc313
+url: https://src.opensuse.org/perl/perl-Statistics-CaseResampling
+revision: 7aeca42ec73bc1e4877aaa17db83fa9f45f2193b49df18950d748778af4fc313
 projectscmsync: https://src.opensuse.org/perl/_ObsPrj
 

++++++ build.specials.obscpio ++++++

++++++ build.specials.obscpio ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/.gitignore new/.gitignore
--- old/.gitignore      1970-01-01 01:00:00.000000000 +0100
+++ new/.gitignore      2026-10-11 13:27:34.000000000 +0200
@@ -0,0 +1 @@
+.osc

Reply via email to