Browse code

core: main - check the debug cli param value

(cherry picked from commit dfc407c4009acbd6e05ecfaf4e727b0636ab92a4)

Daniel-Constantin Mierla authored on 29/04/2022 07:44:46
Showing 1 changed files
... ...
@@ -2084,6 +2084,10 @@ int main(int argc, char** argv)
2084 2084
 					ksr_slog_init(optarg);
2085 2085
 					break;
2086 2086
 			case KARGOPTVAL+8:
2087
+					if (optarg == NULL) {
2088
+						fprintf(stderr, "bad debug level value\n");
2089
+						goto error;
2090
+					}
2087 2091
 					debug_flag = 1;
2088 2092
 					default_core_cfg.debug=(int)strtol(optarg, &tmp, 10);
2089 2093
 					if ((tmp==0) || (*tmp)){