[common] option: fix bounds check in the argument parser.

The recent `pwnkit` exploit brought this to my attention, not that we
are a setuid process we should still do this properly... who knows where
this code might get used in the future.
This commit is contained in:
Geoffrey McRae 2022-01-30 19:56:06 +11:00
parent febd081202
commit db78c8e468

View File

@ -272,6 +272,9 @@ static bool option_set(struct Option * opt, const char * value)
bool option_parse(int argc, char * argv[])
{
if (argc < 1)
return true;
for(int a = 1; a < argc; ++a)
{
struct Option * o = NULL;