[libsoup] Fix a GCC 8.1 warning by using the memcpy instead of strncpy



commit 66d03a6a5510d910b2bfaf517d9c032f522989e4
Author: Tomas Popela <tpopela redhat com>
Date:   Wed Apr 11 12:32:35 2018 +0200

    Fix a GCC 8.1 warning by using the memcpy instead of strncpy
    
    ../libsoup/soup-auth-ntlm.c: In function ‘soup_ntlm_response’:
    ../libsoup/soup-auth-ntlm.c:813:2: warning: ‘strncpy’ output truncated before terminating nul copying 5 
bytes from a string of the same length [-Wstringop-truncation]
      strncpy (out, "NTLM ", 5);

 libsoup/soup-auth-ntlm.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/libsoup/soup-auth-ntlm.c b/libsoup/soup-auth-ntlm.c
index 19a551e..f4009aa 100644
--- a/libsoup/soup-auth-ntlm.c
+++ b/libsoup/soup-auth-ntlm.c
@@ -810,7 +810,7 @@ soup_ntlm_response (const char *nonce,
        ntlm_set_string (&resp.nt_resp, &offset, sizeof (nt_resp));
 
        out = g_malloc (((offset + 3) * 4) / 3 + 6);
-       strncpy (out, "NTLM ", 5);
+       memcpy (out, "NTLM ", 5);
        p = out + 5;
 
        state = save = 0;


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