sys-file-reader: Fix null deref on bad $@Role attribute.
authorBen Pfaff <blp@cs.stanford.edu>
Sun, 23 Sep 2018 04:36:10 +0000 (21:36 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Sun, 23 Sep 2018 04:36:10 +0000 (21:36 -0700)
commit98f90d5547c9a69591cd24eb46f012ee96b2fa30
treefb3ca64f76333109f19cb36a33ac77dfab737ce0
parent53471ab86019d104cddb3a1b8c96400c8da0838b
sys-file-reader: Fix null deref on bad $@Role attribute.

When a variable had a bad $@Role attribute, this was effectively read as
an attribute without any values.  This is the only way to produce such an
attribute.  The system file reader assumed that every attribute had at
least one value and segfaulted if $@Role did not.

This commit fixes both the ultimate cause of the segfault, by dropping
attributes with no values, and the proximate cause, by ignoring $@Role
attributes with no values.  Either fix by itself would be sufficient to
avoid the segfault.

Thanks to Tianxiao Gu for reporting the problem.
Bug #54687.
src/data/sys-file-reader.c