Commit Graph

3 Commits

Author SHA1 Message Date
Dodji Seketeli
1392a720a8 ini: Do not crash on incorrect property value
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>
2023-04-26 22:32:42 +02:00
Giuliano Procida
1ab36e02e5 Add missing newlines to end of test files.
Various test files were missing terminal newlines.

	* tests/data/test-diff-suppr/test0-type-suppr-2.suppr: Add
	final new line.
	* tests/data/test-diff-suppr/test22-suppr-removed-var-sym-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-0.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test23-alias-filter-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-1.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-2.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-3.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test28-add-aliased-function-4.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test41-enumerator-changes-0.suppr:
	Likewise.
	* tests/data/test-diff-suppr/test7-var-suppr-7.suppr:
	Likewise.
	* tests/data/test-ini/test01-equal-in-property-string.abignore:
	Likewise.

Signed-off-by: Giuliano Procida <gprocida@google.com>
2020-10-01 16:11:29 +02:00
Dodji Seketeli
98f972dc1d Bug 23533 - Accept '=' in ini property values
It appears that it's not possible to write a suppression specification
like the below at the moment:

  [suppress_file]
  label = Libabigail can't handle libgfortran.so (https://sourceware.org/bugzilla/show_bug.cgi?id=23492)
  file_name_regexp = libgfortran\\.so.*

This is because the ini parser won't accept the '=' character in the
URL as a valid character for ini property values.

So the entire [suppress_file] section is ignored by the suppression
specification engine.

This patch fixes that by making the equal character valid in property
values.

	* src/abg-ini.cc (char_is_delimiter): Take a new include_equal
	flag to control is the equal character should be considered as a
	delimiter or not.
	(char_is_property_value_char): Accept the equal character as a
	valid property value character.
	* tests/Makefile.am: Build a new runtestini test from the new
	tests/test-ini.cc source file.
	* tests/data/Makefile.am: Add the two new test inputs below to
	source distribution.
	* tests/data/test-ini/test01-equal-in-property-string.{abignore,
	abignore.expected}: New test inputs.
	* tests/test-ini.cc: New test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2018-08-30 10:54:33 +02:00