Browse Source

core: main - check the debug cli param value

Daniel-Constantin Mierla 3 years ago
parent
commit
dfc407c400
1 changed files with 4 additions and 0 deletions
  1. 4 0
      src/main.c

+ 4 - 0
src/main.c

@@ -2100,6 +2100,10 @@ int main(int argc, char** argv)
 					ksr_slog_init(optarg);
 					break;
 			case KARGOPTVAL+8:
+					if (optarg == NULL) {
+						fprintf(stderr, "bad debug level value\n");
+						goto error;
+					}
 					debug_flag = 1;
 					default_core_cfg.debug=(int)strtol(optarg, &tmp, 10);
 					if ((tmp==0) || (*tmp)){