It is not acceptable to index the array out of bounds if an illegal index
authorMatthew Dillon <dillon@dragonflybsd.org>
Thu, 7 Jul 2005 07:17:47 +0000 (07:17 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Thu, 7 Jul 2005 07:17:47 +0000 (07:17 +0000)
commitb30a327b31ea0c660d07af56e0d7eec35120d027
tree4cb42cf6640c64ffb3ff6d6f0f4c3e4b3becebaf
parentf9cc269526d55567223d195fca754b95a650fad4
It is not acceptable to index the array out of bounds if an illegal index
is passed to a ctype function or macro.  Undo the last commit.  Emplace an
explicit range check for the integer passed to the ctype macros and
functions rather then underflowing or overflowing the array.  Currently
return 0 if the integer is out of range (it might be more appropriate to
assert).
include/ctype.h
lib/libc/gen/isctype.c
lib/libc/gen/tolower.c
lib/libc/gen/toupper.c