From 3726808bd5fda236183bb53b80c36d0067dd9a32 Mon Sep 17 00:00:00 2001 From: Thomas White Date: Fri, 22 Oct 2021 12:51:24 +0200 Subject: reflection_new: Check indices are not too large Previously, the combination of reflection_new and add_refl_to_list gave a way to side-step the usual check that the indices were not larger than 512. This causes corruption of the RefList, so much be avoided. --- libcrystfel/src/reflist.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'libcrystfel') diff --git a/libcrystfel/src/reflist.c b/libcrystfel/src/reflist.c index b322e6e1..d60ee46e 100644 --- a/libcrystfel/src/reflist.c +++ b/libcrystfel/src/reflist.c @@ -167,6 +167,9 @@ RefList *reflist_new() */ Reflection *reflection_new(signed int h, signed int k, signed int l) { + assert(abs(h)<512); + assert(abs(k)<512); + assert(abs(l)<512); return new_node(SERIAL(h, k, l)); } -- cgit v1.2.3