Skip to content

cpp/missing-check-scanf: False positive #12412

Open
@ryao

Description

@ryao

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

https://github.com/ryao/zfs/blob/3881dd42bbfb7297f08e796c38b35d54e11ac500/lib/libspl/os/linux/gethostid.c#L50

CodeQL says This variable is read, but may not have been written. It should be guarded by a check that the returns at least 1.. However, that is already being done as part of if (fscanf(f, "%lx", &hostid) != 1).

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions