mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-22 05:27:20 +00:00
[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:
parent
febd081202
commit
db78c8e468
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user