aboutsummaryrefslogtreecommitdiff
path: root/libcrystfel
diff options
context:
space:
mode:
authorThomas White <taw@physics.org>2021-10-22 12:51:24 +0200
committerThomas White <taw@physics.org>2021-10-22 12:51:24 +0200
commit3726808bd5fda236183bb53b80c36d0067dd9a32 (patch)
tree706d6ec502488c754593234fa0f824a460aa1396 /libcrystfel
parentf449a1a3d791ca13940b0495e532a6c961384f3b (diff)
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.
Diffstat (limited to 'libcrystfel')
-rw-r--r--libcrystfel/src/reflist.c3
1 files changed, 3 insertions, 0 deletions
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));
}