libretro / libretro/opera-libretro

A possible uninitialized variable?

Open
#112 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
86
Forks
50
Avg merge
7h 10m
Merged PRs (30d)
1

Description

Hi all,
There is a possible uninitialized variable found by Qihoo360 CodeSafe Team.
Details as bellow:

https://github.com/libretro/4do-libretro/blob/9d76c93c140d227211411b351ad03b8252d21a3a/libfreedo/freedo_madam.c#L2723-L2741

in the 1st time into the for loop, only if the if condition is true (next != curr), variable pixel could be assigned a value.
so, it will be better if an initialization is added when pexel is declared in line 2723.

Cheers
Qihoo360 CodeSafe Team

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

Open libfreedo/freedo_madam.c around lines 2723–2741 and inspect how pixel is used during the first loop iteration when next equals curr. Initialize pixel as proposed, then verify that the possible uninitialized-variable warning is resolved.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.