`DCL30-C`: Replace implementation with cpp/return-stack-allocated-memory

Open
#495 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
45/100
Issue type
Refactor
Clarity
Mostly clear
Activity status
Stale
Tech stack
cpp
Domain
tooling

Research direction

Find the current DCL30-C implementation in this repository, then compare it with the CodeQL query at cpp/ql/src/Likely Bugs/Memory Management/ReturnStackAllocatedMemory.ql, especially the referenced query changes. Done means the rule uses the improved implementation and its existing coverage remains intact.

Written by the indexing model from the issue text.

Description

Difficulty-Medium false positive/false negative Impact-Medium Standard-CERT-C
Affected rules
  • DCL30-C
Description

There have recently been improvements to the C++ standard query for returning stack allocated memory:
https://github.com/github/codeql/blob/4de19b3ec97d4379ef5988bda591d749e1cd0f99/cpp/ql/src/Likely%20Bugs/Memory%20Management/ReturnStackAllocatedMemory.ql#L7

We should adopt this new and improved query which improves both false positive and false negative rates.

Dominant language
CodeQL
Stars
227
Forks
82
Avg merge
6d 7h
Merged PRs (30d)
9

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.

More from github/codeql-coding-standards

All issues in github/codeql-coding-standards

Similar issues

More DevTools issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.