commit | 77992be85d9b34e9037a3ef412484747acb8bad2 | [log] [tgz] |
---|---|---|
author | Nick Kralevich <nnk@google.com> | Fri Aug 28 16:54:02 2015 +0000 |
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | Fri Aug 28 16:54:02 2015 +0000 |
tree | eab0b7bfc934e0fa93028a65a353cafa0834123c | |
parent | 6fc0905112037dbebaf3d94b621ba4ab5e80b760 [diff] | |
parent | 397fae3d418ce705d6143afe709598e57a6a25a1 [diff] |
Merge "VectorImpl.cpp: fix benign multiplication overflow"
diff --git a/libutils/VectorImpl.cpp b/libutils/VectorImpl.cpp index bdb54b1..2f770f5 100644 --- a/libutils/VectorImpl.cpp +++ b/libutils/VectorImpl.cpp
@@ -198,7 +198,10 @@ _do_copy(next, curr, 1); next = curr; --j; - curr = reinterpret_cast<char*>(array) + mItemSize*(j); + curr = NULL; + if (j >= 0) { + curr = reinterpret_cast<char*>(array) + mItemSize*(j); + } } while (j>=0 && (cmp(curr, temp, state) > 0)); _do_destroy(next, 1);