[PATCH 15/16] virNetLibsshAuthenticatePrivkeyCb: Use virStrcpy instead of virStrncpy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux