From ae1344d1a0e1000c315b681e575ef974f928e914 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Tue, 15 May 2018 09:56:42 +1000 Subject: [PATCH] [spice] fix out by one error in call to strncpy --- client/spice/spice.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/spice/spice.c b/client/spice/spice.c index f89f3cc6..1992f51b 100644 --- a/client/spice/spice.c +++ b/client/spice/spice.c @@ -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) { - strncpy(spice.password, password, sizeof(spice.password)); + strncpy(spice.password, password, sizeof(spice.password) - 1); memset(&spice.addr, 0, sizeof(struct sockaddr_in)); inet_pton(AF_INET, host, &spice.addr.sin_addr); spice.addr.sin_family = AF_INET;