diff --git a/ps/sortformat.c b/ps/sortformat.c index ace5fa70..1594da62 100644 --- a/ps/sortformat.c +++ b/ps/sortformat.c @@ -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 */