mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 21:17:54 +00:00
[spice] fix out by one error in call to strncpy
This commit is contained in:
parent
ae382949c8
commit
ae1344d1a0
1 changed files with 1 additions and 1 deletions
|
@ -133,7 +133,7 @@ bool spice_discard (const struct SpiceChannel * channel, ssize_t size);
|
||||||
|
|
||||||
bool spice_connect(const char * host, const short port, const char * password)
|
bool spice_connect(const char * host, const short port, const char * password)
|
||||||
{
|
{
|
||||||
strncpy(spice.password, password, sizeof(spice.password));
|
strncpy(spice.password, password, sizeof(spice.password) - 1);
|
||||||
memset(&spice.addr, 0, sizeof(struct sockaddr_in));
|
memset(&spice.addr, 0, sizeof(struct sockaddr_in));
|
||||||
inet_pton(AF_INET, host, &spice.addr.sin_addr);
|
inet_pton(AF_INET, host, &spice.addr.sin_addr);
|
||||||
spice.addr.sin_family = AF_INET;
|
spice.addr.sin_family = AF_INET;
|
||||||
|
|
Loading…
Reference in a new issue