some gcc 15.2.1 warnings
Open
Nobody has claimed this yet.
maintenance/cleanup
- Dominant language
- C
- Stars
- 13.6k
- Forks
- 2.6k
- PR merge metrics
- No merged PRs in 30d
Description
As requested, some (harmless) gcc (15.2.1) warnings:
unrar.c: In function 'read_tables':
unrar.c:500:56: warning: writing 16 bytes into a region of size 4 [-Wstringop-overflow=]
500 | bit_length[i++]=0;
| ^
unrar.c:450:23: note: at offset [16, 20] into destination object 'bit_length' of size 20
450 | unsigned char bit_length[BC];
| ^
options.c: In function 'opt_init':
options.c:1030:27: warning: 'strchr' reading 1 or more bytes from a region of size 0 [-Wstringop-overread]
1030 | char *e = strchr(s + 1, ':');
| ^
In function 'check_huffman',
inlined from 'check_rar' at rar_common.h:654:10:
rar_common.h:526:57: warning: writing 16 bytes into a region of size 4 [-Wstringop-overflow=]
526 | bit_length[i++] = 0;
| ^
rar_common.h: In function 'check_rar':
rar_common.h:501:23: note: at offset [16, 20] into destination object 'bit_length' of size 20
501 | unsigned char bit_length[20];
| ^
In function 'check_huffman',
inlined from 'check_rar' at rar_common.h:654:10:
rar_common.h:526:57: warning: writing 16 bytes into a region of size 4 [-Wstringop-overflow=]
526 | bit_length[i++] = 0;
| ^
rar_common.h: In function 'check_rar':
rar_common.h:501:23: note: at offset [16, 20] into destination object 'bit_length' of size 20
501 | unsigned char bit_length[20];
| ^
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the reported warnings with GCC 15.2.1 and inspect unrar.c, options.c, and rar_common.h at the cited locations. Determine the intended bounds and input checks from the surrounding functions, then rebuild to confirm the listed warnings are resolved without changing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Needs clarification
- Newbie friendliness
- 38/100