From caf50c07e225ee3a3e149234601e7305b1437736 Mon Sep 17 00:00:00 2001 From: Uli Schlachter Date: Fri, 22 Mar 2013 13:58:04 +0100 Subject: 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 Signed-off-by: Uli Schlachter --- boilerplate/cairo-boilerplate.c | 2 ++ 1 file changed, 2 insertions(+) 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++; -- cgit v1.2.3