[lvm-devel] LVM2/libdm/regex parse_rx.c

agk at sourceware.org agk at sourceware.org
Thu Apr 22 14:33:16 UTC 2010


CVSROOT:	/cvs/lvm2
Module name:	LVM2
Changes by:	agk at sourceware.org	2010-04-22 14:33:16

Modified files:
	libdm/regex    : parse_rx.c 

Log message:
	Don't walk rightmost through NULL pointers.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/LVM2/libdm/regex/parse_rx.c.diff?cvsroot=lvm2&r1=1.7&r2=1.8

--- LVM2/libdm/regex/parse_rx.c	2010/04/22 13:42:34	1.7
+++ LVM2/libdm/regex/parse_rx.c	2010/04/22 14:33:14	1.8
@@ -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 @@
 {
 	int count = 1;
 
-	while (r->type != CHARSET) {
+	while (r->type != CHARSET && LEFT(r)) {
 		count++;
 		r = LEFT(r);
 	}




More information about the lvm-devel mailing list