fix sniffer coverity problem

This commit is contained in:
toddouska 2014-12-03 16:06:28 -08:00
parent a4a3ebb567
commit 3f53d9f229

View File

@ -1102,7 +1102,8 @@ static int SetNamedPrivateKey(const char* name, const char* address, int port,
} }
InitSnifferServer(sniffer); InitSnifferServer(sniffer);
XSTRNCPY(sniffer->address, address, MAX_SERVER_ADDRESS); XSTRNCPY(sniffer->address, address, MAX_SERVER_ADDRESS-1);
sniffer->address[MAX_SERVER_ADDRESS-1] = '\0';
sniffer->server = serverIp; sniffer->server = serverIp;
sniffer->port = port; sniffer->port = port;