identifier: Apply isdigit() only to values in valid range.
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 2 Mar 2012 06:32:42 +0000 (22:32 -0800)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 2 Mar 2012 06:32:42 +0000 (22:32 -0800)
commitc785bf16095624e47d9af976aaa751295a66f3d5
tree41e408346765e85d27ab30ab3d9e1e2c0e89bd41
parent2349f63f2fd06f55ee8644f40ab35132f58cf0b6
identifier: Apply isdigit() only to values in valid range.

Applying isdigit() to a value that is not EOF or in the range
0...UCHAR_MAX yields undefined behavior and in fact caused a
segfault on several Debian architectures for U+FFFD.

Found by "lexer properly reports scan errors" test on Debian buildds.
src/data/identifier.c