mirror of
https://github.com/GOSTSec/sgminer
synced 2025-01-10 14:58:01 +00:00
Avoid null deref in command line arg processing.
Reported by lfm.
This commit is contained in:
parent
18d3ab876c
commit
276dcdbcec
@ -328,7 +328,8 @@ static void parse_arg (int key, char *arg)
|
||||
switch(key) {
|
||||
case 'a':
|
||||
for (i = 0; i < ARRAY_SIZE(algo_names); i++) {
|
||||
if (!strcmp(arg, algo_names[i])) {
|
||||
if (algo_names[i] &&
|
||||
!strcmp(arg, algo_names[i])) {
|
||||
opt_algo = i;
|
||||
break;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user