We already assume that 'retr_passphrase.result' is a string, thus we can use virStrcpy instead. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/rpc/virnetlibsshsession.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/rpc/virnetlibsshsession.c b/src/rpc/virnetlibsshsession.c index 0fc1f66706..2dc8cc8911 100644 --- a/src/rpc/virnetlibsshsession.c +++ b/src/rpc/virnetlibsshsession.c @@ -437,8 +437,7 @@ virNetLibsshAuthenticatePrivkeyCb(const char *prompt, return -1; } - p = virStrncpy(buf, retr_passphrase.result, - retr_passphrase.resultlen, len); + p = virStrcpy(buf, retr_passphrase.result, len); virSecureEraseString(retr_passphrase.result); g_free(retr_passphrase.result); if (p < 0) { -- 2.29.2