ctype bug

Matthew Dillon dillon at apollo.backplane.com
Wed Jul 6 17:29:37 PDT 2005


:>     No, they never worked like this.  Go back and look at rev 1.1 of
:>     ctype.h in the FreeBSD source repository.  Guess what it does?  It
:>     does a range check.
:
:Where? It masks the high bits off, there by mapping 255 and -1 to the same value.
:That's not correct.

    No, it does a range-check by checking whether the high bits are set
    (thereby checking the full range AND negative values at the same time),
    and calls a C procedure instead of blindly indexing the array.  That's
    my point... the original code was robust, and ours is going to be too.

					-Matt
					Matthew Dillon 
					<dillon at xxxxxxxxxxxxx>





More information about the Commits mailing list