[vlc-commits] http_auth: fix -Wstringop-truncation warning

Alexandre Janniaux git at videolan.org
Tue May 19 16:21:02 CEST 2020


vlc | branch: master | Alexandre Janniaux <ajanni at videolabs.io> | Mon May  4 19:36:55 2020 +0200| [f0221dcf5cb9d116ed10fd6b17a2a665bc42cc00] | committer: Alexandre Janniaux

http_auth: fix -Wstringop-truncation warning

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.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f0221dcf5cb9d116ed10fd6b17a2a665bc42cc00
---

 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 4d49978ac9..599fda6286 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
     {



More information about the vlc-commits mailing list