Put zero string terminator
This commit is contained in:
parent
87eb62b4eb
commit
95faab9bd8
1 changed files with 1 additions and 0 deletions
|
@ -282,6 +282,7 @@ bool Pool::parseIPv6(const char *addr)
|
||||||
const size_t size = end - addr;
|
const size_t size = end - addr;
|
||||||
char *host = static_cast<char *>(malloc(size));
|
char *host = static_cast<char *>(malloc(size));
|
||||||
memcpy(host, addr + 1, size - 1);
|
memcpy(host, addr + 1, size - 1);
|
||||||
|
host[size - 1] = 0;
|
||||||
|
|
||||||
m_host = host;
|
m_host = host;
|
||||||
m_port = static_cast<uint16_t>(strtol(port + 1, nullptr, 10));
|
m_port = static_cast<uint16_t>(strtol(port + 1, nullptr, 10));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue