Skip to contentSkip to conversation

LVM2/libdm/regex parse_rx.c

PATCH [email protected] 1 participant 1 message Aug 9, 2010

lore
Share & tools
lore
#0 lore raw

CVSROOT: /cvs/lvm2
Module name: LVM2
Changes by: thornber at sourceware.org 2010-08-09 10:29:42

Modified files:
libdm/regex : parse_rx.c

Log message:
[REGEX] Parse regexes that contain chars with value > 0x80

This is a long standing issue. Fixed by casting a char value to unsigned char before using it as an index into a bitset.

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

libdm/regex/parse_rx.c +1 -1
@@ -271,7 +271,7 @@
 		ps->type = 0;
 		ps->cursor = ptr + 1;
 		dm_bit_clear_all(ps->charset);
-		dm_bit_set(ps->charset, (int) *ptr);
+		dm_bit_set(ps->charset, (int) (unsigned char) *ptr);
 		break;
 	}