diff --git a/src/benchmark.cc b/src/benchmark.cc index 07942eba..b751b9c3 100644 --- a/src/benchmark.cc +++ b/src/benchmark.cc @@ -435,7 +435,7 @@ void ParseCommandLineFlags(int* argc, char** argv) { using namespace benchmark; BenchmarkReporter::Context::executable_name = (argc && *argc > 0) ? argv[0] : "unknown"; - for (int i = 1; i < *argc; ++i) { + for (int i = 1; argc && i < *argc; ++i) { if (ParseBoolFlag(argv[i], "benchmark_list_tests", &FLAGS_benchmark_list_tests) || ParseStringFlag(argv[i], "benchmark_filter", &FLAGS_benchmark_filter) ||