openwall / openwall/john

some gcc 15.2.1 warnings

Open
#5,879 5 comments 0 reactions 0 assignees View on GitHub

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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.