github / github/codeql

CPP: Some guard questions about control

Open
#10,568 4 comments 0 reactions 0 assignees View on GitHub
question
Dominant language
CodeQL
Stars
10.1k
Forks
2.1k
Avg merge
2d 15h
Merged PRs (30d)
141

Description

Hi!
I want to detect if there is a check for NULL return value of a function.And I want to get the block which is controlled by `ret == NULL`
So Do I have to consider the following four cases?
```
if(ret == NULL) //comparesEq(ret, null, 0, true, true))
if(ret != NULL) //comparesEq(ret, null, 0, false, true)
if(ret) // I don't know yet how to write this
if(!ret) //I don't know yet how to write this
```
Or Is there a method that includes the above four cases?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.