test: Fix handling of dots in CAIRO_TEST_TARGET

Before this, the following happened:

  $ CAIRO_TEST_TARGET=image,xcb-render-0.0 make test
  Cannot find target 'image'.
  Known targets: image, [...]

The reason for this is that _cairo_boilerplate_target_matches_name() doesn't get
a null-terminated string, but instead has a pointer to the end of the string.
However, strpbrk() expects a null-terminated argument and thus could return a
result which points past the end of the input.

This commit fixes exactly this.

Reported-by: Darxus <darxus@chaosreigns.com>
Signed-off-by: Uli Schlachter <psychon@znc.in>
This commit is contained in:
Uli Schlachter 2013-03-22 13:58:04 +01:00
parent 13bd8d09b4
commit caf50c07e2

View file

@ -514,6 +514,8 @@ _cairo_boilerplate_target_matches_name (const cairo_boilerplate_target_t *target
size_t name_len;
size_t content_len;
if (content_start >= end)
content_start = NULL;
if (content_start != NULL)
end = content_start++;