HomeFreeBSD

cppcheck: zpool_main.c possible null pointer dereference

Description

cppcheck: zpool_main.c possible null pointer dereference

Explicitly check for NULL to satisfy cppcheck that "val" can never
be NULL when passed to printf(). This looks like a false positive
since is_blank_str() can never take the false conditional branch
when passed a NULL. But there's no harm in adding the extra check.

Reviewed-by: Ryan Moeller <ryan@ixsystems.com>
Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Closes #11508

Details

Provenance
Brian Behlendorf <behlendorf1@llnl.gov>Authored on Jan 22 2021, 11:03 PM
Parents
rG62d4287f279a: RAIDZ2/3 fails to heal silently corrupted parity w/2+ bad disks
Branches
Unknown
Tags
Unknown

Event Timeline

Brian Behlendorf <behlendorf1@llnl.gov> committed rG7454d2bb8d86: cppcheck: zpool_main.c possible null pointer dereference (authored by Brian Behlendorf <behlendorf1@llnl.gov>).Jan 27 2021, 12:11 AM