[vlc-devel] [PATCH] http_auth: fix -Wstringop-truncation warning

Alexandre Janniaux ajanni at videolabs.io
Mon May 4 19:38:10 CEST 2020


The size of hashes are fixed so there is no need for str functions, as
otherwise strncpy complains about having the destination size equal to
the given size with fortify.
---
 src/network/http_auth.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/network/http_auth.c b/src/network/http_auth.c
index 4d49978ac97..599fda6286d 100644
--- a/src/network/http_auth.c
+++ b/src/network/http_auth.c
@@ -125,7 +125,7 @@ static char *AuthDigest( vlc_object_t *p_this, vlc_http_auth_t *p_auth,
     /* H(A1) */
     if ( p_auth->psz_HA1 )
     {
-        strncpy( psz_HA1, p_auth->psz_HA1, sizeof(psz_HA1) );
+        memcpy( psz_HA1, p_auth->psz_HA1, sizeof(psz_HA1) );
     }
     else
     {
-- 
2.26.2



More information about the vlc-devel mailing list