Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

calloc() calls

Open
#34 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

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

Research direction

Start by searching the repository for calloc(sizeof(, especially the calls shown in src/jtag/drivers/ulink.c and src/target/nds32.c. Compare the current code with the upstream fix referenced in the issue, then verify that all affected calls use the intended argument order and that the relevant code still builds.

Written by the indexing model from the issue text.

Description

Hi,

correct me, if I'm wrong, but I found bunch of calls to calloc(), that seem to me to have bad order of arguments. The interface is void *calloc(size_t num, size_t size), but here is an example: tdo_buffer_start = calloc(sizeof(uint8_t), scan_size_bytes);.

At some locations there it is even combination of corrent and in-correct calls, like here.

Another locations can be easily found, when searching for calloc(sizeof(.

It is possible, it is just that I didn't look into the code deeper and more thoroughly, I indeed didn't, but...

EDIT: It seems this problem was fixed upstream about half year ago, so maybe it is somewhere in the queue already.

Dominant language
C
Stars
202
Forks
57
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 STMicroelectronics/OpenOCD

All issues in STMicroelectronics/OpenOCD

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.