9645 scf_read_propvec segfaults on error

Review Request #1128 - Created July 10, 2018 and updated

Information
Andrew Stormont
illumos-gate
9645
Reviewers
general

scf_read_propvec walks the prop vector setting the addresses for certain property types (such as opaque and astring, since they are dynamically sized) and sets them to NULL. On error it calls scf_clean_propvec which checks the addresses before freeing them and skips over any set to NULL. The problem is that in some failure scenarios this is called before the addresses have been initialized, causing a segfault.

Error path no longer segfaults.

Andrew Stormont
Review request changed
Vitaliy Gusev

   
usr/src/lib/libscf/common/midlevel.c (Diff revision 2)
 
 
Could you add extra comment like "do initialization"? ?
Loading...