Skip to content

Commit 7956a47

Browse files
committed
lzma: fix overflow in Bcj2Enc.c
crnlib/lzma/Bcj2Enc.c: In function ‘Bcj2Enc_Encode’: crnlib/lzma/Bcj2Enc.c:488:20: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=] 488 | p->temp[i] = src[i]; | ~~~~~~~~~~~^~~~~~~~ In file included from crnlib/lzma/Bcj2Enc.c:14: crnlib/lzma/Bcj2.h:287:8: note: at offset 8 into destination object ‘temp’ of size 8 287 | Byte temp[8]; | ^
1 parent c2eaa81 commit 7956a47

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crnlib/lzma/Bcj2Enc.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,7 @@ void Bcj2Enc_Encode(CBcj2Enc *p)
486486
// (0 < p->tempPos <= 4)
487487
do
488488
p->temp[i] = src[i];
489-
while (++i != rem);
489+
while (++i != rem + 1);
490490
}
491491
// (p->tempPos <= 4)
492492
// (p->src == p->srcLim)

0 commit comments

Comments
 (0)