rhboot / rhboot/shim

realloc is 1 byte short

Open
#744 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
1.1k
Forks
348
PR merge metrics
No merged PRs in 30d

Description

https://github.com/rhboot/shim/blob/d44405e85b8560c5f41a40abe1e9f230ca704cc1/generate_sbat_var_defs.c#L60

the realloc is 1 byte or 2 bytes too short, specifically as revocationsp is incremented by 1 byte more already below.

                                    revocationsp =
                                            revocationsp + strlen(line) + 2;

(CC @dennis-tseng99 )

Contributor guide

No contributing guide indexed for this repository

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 in generate_sbat_var_defs.c around line 60 and inspect the realloc size together with the later revocationsp increment. Confirm the allocation covers the full string data and terminators, then verify the change with the repository's available build or test process.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.