Skip to content

Commit ee6da8b

Browse files
committed
Fix OOB memory access
1 parent 486f852 commit ee6da8b

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

pyramidal.c

+5-3
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,11 @@ void shift_and_mark(PACK_T *source, PACK_T *target, unsigned long long length, u
132132
target[i + access_offset] |= shifted[0];
133133
target[i + 1 + access_offset] |= shifted[1];
134134
}
135-
i = stop;
136-
ext_shift(source[i], bitoff, shifted);
137-
target[i + access_offset] |= shifted[0];
135+
if (i + access_offset > 0) {
136+
i = stop;
137+
ext_shift(source[i], bitoff, shifted);
138+
target[i + access_offset] |= shifted[0];
139+
}
138140
return;
139141
}
140142

0 commit comments

Comments
 (0)