Skip to content

Commit c1d2a13

Browse files
committed
Fixed potential flaw in arguments parsing
1 parent 7071816 commit c1d2a13

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -272,13 +272,13 @@ bool parseArguments(int argc, char** argv, ParamsStruct* params){
272272
switch(c){
273273
case 'l':
274274
value = strtoul(optarg,NULL,10);
275-
if(value <= LIBUSB_LOG_LEVEL_DEBUG){
275+
if(value >= LIBUSB_LOG_LEVEL_NONE && value <= LIBUSB_LOG_LEVEL_DEBUG){
276276
params->libusbDebugLevel = value;
277277
}
278278
break;
279279
case 'i':
280280
value = strtoul(optarg,NULL,10);
281-
if(value <= 1000000){
281+
if(value <= 1000000 && value > 0){
282282
params->intervalUSec = value;
283283
}
284284
break;

0 commit comments

Comments
 (0)