HomeFreeBSD

Fix possible NULL pointer dereference in sha2_mac_init()

Description

Fix possible NULL pointer dereference in sha2_mac_init()

If mechanism->cm_param is NULL, passing mechanism to
PROV_SHA2_GET_DIGEST_LEN() will dereference a NULL pointer.

Coverity reported this.

Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov>
Signed-off-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Closes #14044

Details

Provenance
Richard Yao <richard.yao@alumni.stonybrook.edu>Authored on Oct 17 2022, 6:06 AM
Tony Hutter <hutter2@llnl.gov>Committed on Dec 1 2022, 8:39 PM
Parents
rG89c41f3979c1: set_global_var() should not pass NULL pointers to dlclose()
Branches
Unknown
Tags
Unknown

Event Timeline

Tony Hutter <hutter2@llnl.gov> committed rGaf2e53f62c0a: Fix possible NULL pointer dereference in sha2_mac_init() (authored by Richard Yao <richard.yao@alumni.stonybrook.edu>).Dec 1 2022, 8:39 PM