Commit f258ec23 authored by Angelo Failla's avatar Angelo Failla Committed by Facebook Github Bot

Fix ASAN reported bug

Reviewed By: yfeldblum

Differential Revision: D4898404

fbshipit-source-id: 82256ae3dcd76444dc1b192d3bb6d50f142cee81
parent 404a98c4
......@@ -186,14 +186,14 @@ IPAddressV6 IPAddressV6::fromInverseArpaName(const std::string& arpaname) {
throw IPAddressFormatException(sformat("Invalid input. Got '{}'", piece));
}
std::array<char, IPAddressV6::kToFullyQualifiedSize> ip;
int pos = 0;
size_t pos = 0;
int count = 0;
for (int p = pieces.size() - 1; p >= 0; p--) {
ip[pos] = pieces[p][0];
pos++;
count++;
// add ':' every 4 chars
if (count == 4) {
if (count == 4 && pos < ip.size()) {
ip[pos++] = ':';
count = 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment