[mlpack-git] master: Catch edge case that could cause out-of-bounds access. (139ad60)
gitdub at mlpack.org
gitdub at mlpack.org
Tue Nov 1 11:52:28 EDT 2016
Repository : https://github.com/mlpack/mlpack
On branch : master
Link : https://github.com/mlpack/mlpack/compare/981ffa2d67d8fe38df6c699589005835fef710ea...04551164d9950dbdb3738f0c9d87e2d498fd8192
>---------------------------------------------------------------
commit 139ad60d5f2f450a3c08c00f3ecea970a48d277e
Author: Ryan Curtin <ryan at ratml.org>
Date: Tue Nov 1 11:52:28 2016 -0400
Catch edge case that could cause out-of-bounds access.
>---------------------------------------------------------------
139ad60d5f2f450a3c08c00f3ecea970a48d277e
src/mlpack/core/util/cli.cpp | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/mlpack/core/util/cli.cpp b/src/mlpack/core/util/cli.cpp
index 4cbfc3a..166da9f 100644
--- a/src/mlpack/core/util/cli.cpp
+++ b/src/mlpack/core/util/cli.cpp
@@ -342,7 +342,8 @@ void CLI::ParseCommandLine(int argc, char** line)
// If neither has a value, consider it a duplicate flag and remove
// the duplicate. It's important to not break out of this loop
// because there might be another duplicate later on in the vector.
- bpo.options.erase(bpo.options.begin() + j);
+ bpo.options.erase(bpo.options.begin() + j);
+ --j;
}
else
{
More information about the mlpack-git
mailing list