]> sourceware.org Git - lvm2.git/commitdiff
Don't walk rightmost through NULL pointers.
authorAlasdair Kergon <agk@redhat.com>
Thu, 22 Apr 2010 14:33:14 +0000 (14:33 +0000)
committerAlasdair Kergon <agk@redhat.com>
Thu, 22 Apr 2010 14:33:14 +0000 (14:33 +0000)
libdm/regex/parse_rx.c

index d642cee22c4b81cc6fb6c293b3b977058f49f50d..b1d362ffbdbfd501dd98a3f910882ce43f90e817 100644 (file)
@@ -16,8 +16,6 @@
 #include "dmlib.h"
 #include "parse_rx.h"
 
-#include <ctype.h>
-
 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);
        }
This page took 0.033597 seconds and 5 git commands to generate.