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:
parent
afca7eee75
commit
db00f54f4a
@ -428,6 +428,7 @@ static const char *verify_short_sort(const char *arg){
|
|||||||
walk = arg;
|
walk = arg;
|
||||||
for(;;){
|
for(;;){
|
||||||
tmp = *walk;
|
tmp = *walk;
|
||||||
|
if(tmp < 0 || (size_t)tmp >= sizeof(checkoff)) return _("bad sorting code");
|
||||||
switch(tmp){
|
switch(tmp){
|
||||||
case '\0':
|
case '\0':
|
||||||
return NULL; /* looks good */
|
return NULL; /* looks good */
|
||||||
|
Loading…
Reference in New Issue
Block a user