commit fa18c937930ec2e14dce2d31e81cfee4be8310cf
parent 56641effa9d09c5bb7ffcdbe5bfae364e983b73c
Author: Vincent Forest <vincent.forest@meso-star.com>
Date: Mon, 20 Apr 2026 15:34:16 +0200
sln-slab: correction of an invalid memory access
If a leaf could not be sampled due to an error during the tree
traversal, the returned node is null but has not been checked since
commit e617841, resulting in an invalid memory access.
Diffstat:
1 file changed, 1 insertion(+), 0 deletions(-)
diff --git a/src/sln_slab.c b/src/sln_slab.c
@@ -515,6 +515,7 @@ realisation
/* Importance sampling of a line */
node = sample_leaf(cmd, rng, nu, &leaf_proba);
+ if(!node) { res = RES_BAD_ARG; goto error; }
/* Evaluate the value of the line and compute the probability of being
* absorbed by it */