[tbb-commits] [tor-browser/tor-browser-52.4.1esr-7.5-1] Bug 1305396 - Replace memmove with std::copy_backward in a file that doesn't include cstring explicitly. r=keeler
gk at torproject.org
gk at torproject.org
Fri Oct 20 08:31:29 UTC 2017
commit e6cd07862cf0de06b9cc7c091f9d2dd32cd76280
Author: Nicolas Vigier <boklm at torproject.org>
Date: Mon Oct 16 20:03:54 2017 +0200
Bug 1305396 - Replace memmove with std::copy_backward in a file that doesn't include cstring explicitly. r=keeler
---
security/pkix/lib/pkixnames.cpp | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/security/pkix/lib/pkixnames.cpp b/security/pkix/lib/pkixnames.cpp
index ca9b8d7d3770..95aa41382a03 100644
--- a/security/pkix/lib/pkixnames.cpp
+++ b/security/pkix/lib/pkixnames.cpp
@@ -34,6 +34,8 @@
// constraints, the reference identifier is the entire encoded name constraint
// extension value.
+#include <algorithm>
+
#include "pkixcheck.h"
#include "pkixutil.h"
@@ -1705,11 +1707,9 @@ FinishIPv6Address(/*in/out*/ uint8_t (&address)[16], int numComponents,
}
// Shift components that occur after the contraction over.
- size_t componentsToMove = static_cast<size_t>(numComponents -
- contractionIndex);
- memmove(address + (2u * static_cast<size_t>(8 - componentsToMove)),
- address + (2u * static_cast<size_t>(contractionIndex)),
- componentsToMove * 2u);
+ std::copy_backward(address + (2u * static_cast<size_t>(contractionIndex)),
+ address + (2u * static_cast<size_t>(numComponents)),
+ address + (2u * 8u));
// Fill in the contracted area with zeros.
std::fill_n(address + 2u * static_cast<size_t>(contractionIndex),
(8u - static_cast<size_t>(numComponents)) * 2u, static_cast<uint8_t>(0u));
More information about the tbb-commits
mailing list