1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-29 15:22:30 +03:00

Don't walk rightmost through NULL pointers.

This commit is contained in:
Alasdair Kergon 2010-04-22 14:33:14 +00:00
parent 9d8d6b1d18
commit 5ce8c9ae77

View 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);
}