From 78d3289faef1e1acc05eaf7108405eb611bfa017 Mon Sep 17 00:00:00 2001 From: John Mark Bell Date: Thu, 12 Feb 2009 19:09:15 +0000 Subject: Don't attempt to match details on a NULL pointer svn path=/trunk/libcss/; revision=6460 --- src/select/select.c | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/select/select.c b/src/select/select.c index 1d6740f..4159607 100644 --- a/src/select/select.c +++ b/src/select/select.c @@ -687,18 +687,21 @@ css_error match_universal_combinator(css_select_ctx *ctx, css_combinator type, break; } - /* Match its details */ - error = match_details(ctx, n, detail, state, &match); - if (error != CSS_OK) - return error; + if (n != NULL) { + /* Match its details */ + error = match_details(ctx, n, detail, state, &match); + if (error != CSS_OK) + return error; - /* If we found a match, use it */ - if (match == true) - break; + /* If we found a match, use it */ + if (match == true) + break; - /* Wanted the parent, but it didn't match, so stop looking */ - if (type == CSS_COMBINATOR_PARENT) - n = NULL; + /* Wanted the parent, but it didn't match, + * so stop looking */ + if (type == CSS_COMBINATOR_PARENT) + n = NULL; + } } while (n != NULL); *next_node = n; -- cgit v1.2.3