Skip to content

cpp/uninitialized-local - false positive #11240

@ryao

Description

@ryao

Description of the false positive

https://github.com/ryao/zfs/security/code-scanning/694

https://github.com/ryao/zfs/blob/15e39c6d547afb7e8df515582516f318dd5d0183/lib/libzpool/kernel.c#L1205-L1205

CodeQL complains that done is potentially uninitialized. However, done is set when rc != -1, so it is only uninitialized when rc == -1. Then the function terminates when rc < 0 before reaching the line where done is used. There is no path that can reach that line that leaves done uninitialized. Therefore, this is a false positive.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions