ps/sortformat.c: Double-check chars in verify_short_sort().

To avoid an out-of-bounds access at checkoff[tmp]. The strspn() at the
beginning of the function protects against it already, but double-check
this in case of some future change.
This commit is contained in:
Qualys Security Advisory 1970-01-01 00:00:00 +00:00 committed by Craig Small
parent afca7eee75
commit db00f54f4a

View File

@ -428,6 +428,7 @@ static const char *verify_short_sort(const char *arg){
walk = arg;
for(;;){
tmp = *walk;
if(tmp < 0 || (size_t)tmp >= sizeof(checkoff)) return _("bad sorting code");
switch(tmp){
case '\0':
return NULL; /* looks good */