From beb32c4d79c00153c81882b1da97b3a8fa3b7552 Mon Sep 17 00:00:00 2001 From: David Wells Date: Wed, 24 Dec 2025 11:36:34 -0500 Subject: [PATCH] Fix an invalid read. If num_results == 0 then dynamic_idx is empty, so dynamic_idx[0] does not exist. --- tests/test_main.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/test_main.cpp b/tests/test_main.cpp index 8821470..4e7724c 100644 --- a/tests/test_main.cpp +++ b/tests/test_main.cpp @@ -797,6 +797,8 @@ void L2_concurrent_build_vs_L2_test(const size_t nSamples, const size_t DIM) template void L2_dynamic_sorted_test(const size_t N, const size_t num_results) { + if (num_results == 0) return; + PointCloud cloud; generateRandomPointCloud(cloud, N);