diff options
author | Uli Schlachter <psychon@znc.in> | 2013-03-22 13:58:04 +0100 |
---|---|---|
committer | Uli Schlachter <psychon@znc.in> | 2013-03-22 14:02:09 +0100 |
commit | caf50c07e225ee3a3e149234601e7305b1437736 (patch) | |
tree | 6d893df917ab89273b071c8e60bdd74ddea16f84 | |
parent | 13bd8d09b44e50649f6fc4d58d036bc32c1d5c5b (diff) |
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>
-rw-r--r-- | boilerplate/cairo-boilerplate.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/boilerplate/cairo-boilerplate.c b/boilerplate/cairo-boilerplate.c index 41db8b88..674c8d09 100644 --- a/boilerplate/cairo-boilerplate.c +++ b/boilerplate/cairo-boilerplate.c @@ -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++; |