When the value of the 'name_regexp' property is incorrect, the ini
parser can crash.
Pancake, of Radare2 fame, reported this one by email.
Fixed thus.
* src/abg-ini.cc (read_context::read_property_value): Do not
dereference a null pointer to list property value.
* tests/data/test-ini/test02-buggy-property-value.abignore: New
test input.
* tests/data/test-ini/test02-buggy-property-value.abignore.expected:
Likewise.
* tests/data/Makefile.am: Add the two new test inputs to source
distribution.
* tests/test-ini.cc (in_out_spec): Add the new test input pair to
this test harness.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
}
list_property_value_sptr list = read_list_property_value();
- if (list->get_content().size() == 1)
+ if (list && list->get_content().size() == 1)
result.reset(new string_property_value(list->get_content()[0]));
else
result = list;
\
test-ini/test01-equal-in-property-string.abignore.expected \
test-ini/test01-equal-in-property-string.abignore \
+test-ini/test02-buggy-property-value.abignore \
+test-ini/test02-buggy-property-value.abignore.expected \
\
test-kmi-whitelist/whitelist-with-single-entry \
test-kmi-whitelist/whitelist-with-another-single-entry \
--- /dev/null
+[suppress_function]
+ name_regexp = [
\ No newline at end of file
"output/test-ini/test01-equal-in-property-string.abignore",
""
}
+ {
+ "data/test-ini/test02-buggy-property-value.abignore",
+ "data/test-ini/test02-buggy-property-value.abignore.expected",
+ "output/test-ini/test02-buggy-property-value.abignore",
+ ""
+ }
,
// This one must always remain the last one.
{0, 0, 0, 0}