mirror of
https://github.com/google/benchmark.git
synced 2025-01-31 06:10:14 +08:00
fix argv accessed out of bounds in ParseCommandLineFlags() (#321)
This commit is contained in:
parent
efd4e992a6
commit
56336e70f1
@ -634,7 +634,7 @@ void ParseCommandLineFlags(int* argc, char** argv) {
|
||||
// TODO: Remove this.
|
||||
ParseStringFlag(argv[i], "color_print", &FLAGS_benchmark_color) ||
|
||||
ParseInt32Flag(argv[i], "v", &FLAGS_v)) {
|
||||
for (int j = i; j != *argc; ++j) argv[j] = argv[j + 1];
|
||||
for (int j = i; j != *argc - 1; ++j) argv[j] = argv[j + 1];
|
||||
|
||||
--(*argc);
|
||||
--i;
|
||||
|
Loading…
Reference in New Issue
Block a user