From d556c0444da8f8b7f4761d3b59340262857962f6 Mon Sep 17 00:00:00 2001 From: Charalampos Stratakis Date: Wed, 28 Jan 2026 01:54:42 +0100 Subject: [PATCH] BUG: specfun/specfun.h: initialize kd in mtu12 to fix potential uninitialized use The kd variable was not initialized before the kf==1/kf==2 conditional blocks. If kf had an unexpected value, kd would be used uninitialized when passed to cva2(). Initialize to 0 for consistency with mtu0. Uncovered by Coverity static analysis. --- include/xsf/specfun/specfun.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xsf/specfun/specfun.h b/include/xsf/specfun/specfun.h index 72c384f64d..940833e3d1 100644 --- a/include/xsf/specfun/specfun.h +++ b/include/xsf/specfun/specfun.h @@ -4760,7 +4760,7 @@ namespace specfun { T eps = 1.0e-14; T a, qm, c1, c2, u1, u2, w1, w2; - int kd, km, ic, k, nm = 0; + int kd = 0, km, ic, k, nm = 0; if ((kf == 1) && (m % 2 == 0)) { kd = 1;