Writing 1 byte into a region of size 0 in Bcj2Enc.c
A free file archiver for extremely high compression
Brought to you by:
ipavlov
Not sure this is the right place for reporting it, but this is about the LZMA SDK 26.01. I first noticed the issue years ago (with older SDKs) but I had not found time to report it before. I'm currently reproducing it with GCC 13 on Linux. This warning is reported:
Bcj2Enc.c: In function ‘Bcj2Enc_Encode’:
Bcj2Enc.c:488:20: warning: writing 1 byte into a region of size 0 [-Wstringop-overflow=]
488 | p->temp[i] = src[i];
| ~~~~~~~~~~~^~~~~~~~
Bcj2Enc.c:14:
Bcj2.h:287:8: note: at offset 8 into destination object ‘temp’ of size 8
287 | Byte temp[8];
| ^~~~
I don't know if that's a false positive or not. I noticed it when upgrading LZMA from https://github.com/DaemonEngine/crunch.
false positive