summaryrefslogtreecommitdiff
path: root/src/select/select.c
diff options
context:
space:
mode:
authorJohn Mark Bell <jmb@netsurf-browser.org>2009-02-12 19:09:15 +0000
committerJohn Mark Bell <jmb@netsurf-browser.org>2009-02-12 19:09:15 +0000
commit78d3289faef1e1acc05eaf7108405eb611bfa017 (patch)
tree8e09d92e9cd1f3caab44c21a6b99698063853732 /src/select/select.c
parent09f914769370bee27e5a5dddbcb2c8da8b3925b9 (diff)
downloadlibcss-78d3289faef1e1acc05eaf7108405eb611bfa017.tar.gz
libcss-78d3289faef1e1acc05eaf7108405eb611bfa017.tar.bz2
Don't attempt to match details on a NULL pointer
svn path=/trunk/libcss/; revision=6460
Diffstat (limited to 'src/select/select.c')
-rw-r--r--src/select/select.c23
1 files changed, 13 insertions, 10 deletions
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;