Closed arnejpackz closed 8 years ago
Sorry on business trip. But if I remember right this was corrected. Could you verify if this is still in the current trunk on sourceforge.net ?
Thank you, Harald
Am 03.09.2015 um 09:45 schrieb arnejpackz:
You can find this code twicein plessey.c:
for(i = src_len - 1; i >= 0; i--) { x += weight * ctoi(source[i]);
The problem is that i was declared unsigned, so this is an infinite loop (until the point of memory corruption). The easiest fix is to modify to
for(i = src_len; i; i--) { x += weight * ctoi(source[ i - 1 ]);
It appears you are correct. I forgot to compare to the current master brach. The latest code is no longer using unsigned integers.
You can find this code twice in plessey.c:
for(i = src_len - 1; i >= 0; i--) { x += weight * ctoi(source[i]);
The problem is that i was declared unsigned, so this is an infinite loop (until the point of memory corruption). The easiest fix is to modify to
for(i = src_len; i; i--) { x += weight * ctoi(source[ i - 1 ]);