From 7c94aad9b1d7e8daf6a80eb0fac1622af5bde4e6 Mon Sep 17 00:00:00 2001 From: Cris Luengo Date: Thu, 12 Aug 2021 08:53:36 -0600 Subject: [PATCH] Fix typo that cuases out-of-bounds read See https://github.com/DIPlib/diplib/issues/81. --- libics_read.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libics_read.c b/libics_read.c index 90d3b66..6f4371f 100644 --- a/libics_read.c +++ b/libics_read.c @@ -1039,7 +1039,7 @@ Ics_Error IcsReadIcs(Ics_Header *icsStruct, for (sj = 0, si = 0; si < parameters; si++) { if (si == bits) { icsStruct->imel.origin = origin[si]; - icsStruct->imel.scale = scale[i]; + icsStruct->imel.scale = scale[si]; strcpy(icsStruct->imel.unit, unit[si]); } else { icsStruct->dim[sj].size = sizes[si];