0064-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 7bd4f0b6d7
commit aad2b13690

View File

@ -427,6 +427,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 */