From 5ce8c9ae77d4c0c61d727449a5bea5a1c239550e Mon Sep 17 00:00:00 2001 From: Alasdair Kergon Date: Thu, 22 Apr 2010 14:33:14 +0000 Subject: [PATCH] Don't walk rightmost through NULL pointers. --- libdm/regex/parse_rx.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/libdm/regex/parse_rx.c b/libdm/regex/parse_rx.c index d642cee22..b1d362ffb 100644 --- a/libdm/regex/parse_rx.c +++ b/libdm/regex/parse_rx.c @@ -16,8 +16,6 @@ #include "dmlib.h" #include "parse_rx.h" -#include - struct parse_sp { /* scratch pad for the parsing process */ struct dm_pool *mem; int type; /* token type, 0 indicates a charset */ @@ -345,7 +343,7 @@ static unsigned _depth(struct rx_node *r, unsigned leftmost) { int count = 1; - while (r->type != CHARSET) { + while (r->type != CHARSET && LEFT(r)) { count++; r = LEFT(r); } -- 2.43.5