From 09a1a42dc6e17a330bdd2600d6204f95b4119f76 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Tue, 18 Aug 2020 17:30:18 +0200 Subject: predict-refine: Remove out-of-bounds GSL vector access We got away with this because the GSL error handler is turned off in indexamjig.c, and invalid accesses are defined to return 0. However, these accesses should have been removed when the clen refinement was disabled in predict-refine --- libcrystfel/src/predict-refine.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'libcrystfel') diff --git a/libcrystfel/src/predict-refine.c b/libcrystfel/src/predict-refine.c index 17194fbf..a9ba6966 100644 --- a/libcrystfel/src/predict-refine.c +++ b/libcrystfel/src/predict-refine.c @@ -495,12 +495,13 @@ static int iterate(struct reflpeak *rps, int n, UnitCell *cell, csx += gsl_vector_get(shifts, 6); csy += gsl_vector_get(shifts, 7); csz += gsl_vector_get(shifts, 8); - update_detector(image->detgeom, gsl_vector_get(shifts, 9), - gsl_vector_get(shifts, 10), - gsl_vector_get(shifts, 11)); + update_detector(image->detgeom, + gsl_vector_get(shifts, 9), + gsl_vector_get(shifts, 10), + 0.0); *total_x += gsl_vector_get(shifts, 9); *total_y += gsl_vector_get(shifts, 10); - *total_z += gsl_vector_get(shifts, 11); + *total_z += 0.0; cell_set_reciprocal(cell, asx, asy, asz, bsx, bsy, bsz, csx, csy, csz); -- cgit v1.2.3