CodeQL warning: Wrong type of arguments to formatting function (CWE-686)

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

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
cli

Research direction

Inspect the reported locations in main/build/_deps/picotool-src/main.cpp and compare each format specifier with its argument type. Review the proposed fix in issue #274, then verify that the CodeQL warnings for the listed lines are resolved.

Written by the indexing model from the issue text.

Description

I noticed that CodeQL is flagging following:

main/build/_deps/picotool-src/main.cpp:2876
This format specifier for type 'int' does not match the argument type 'unsigned long'.
This format specifier for type 'int' does not match the argument type 'unsigned long'.

main/build/_deps/picotool-src/main.cpp:5267
This format specifier for type 'int' does not match the argument type 'fpos<__mbstate_t>'.

main/build/_deps/picotool-src/main.cpp:5365
This format specifier for type 'int' does not match the argument type 'fpos<__mbstate_t>'.

main/build/_deps/picotool-src/main.cpp:6565
This format specifier for type 'int' does not match the argument type 'unsigned long'.

Proposed fix: #274

Dominant language
C++
Stars
999
Forks
189
PR merge metrics
No merged PRs in 30d

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.

More from raspberrypi/picotool

All issues in raspberrypi/picotool

Similar issues

More C++ issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.