[Privoxy-commits] [privoxy] branch master updated: mbedTLS get_ciphersuites_from_string(): Use strlcpy() instead of strncpy()

User Git git at git.privoxy.org
Mon Jul 5 10:32:44 UTC 2021


This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository privoxy.

The following commit(s) were added to refs/heads/master by this push:
     new b61d1132 mbedTLS get_ciphersuites_from_string(): Use strlcpy() instead of strncpy()
b61d1132 is described below

commit b61d113242ae011a41e56ccc915644ce1716ea88
Author: Fabian Keil <fk at fabiankeil.de>
AuthorDate: Wed Jun 30 14:58:12 2021 +0200

    mbedTLS get_ciphersuites_from_string(): Use strlcpy() instead of strncpy()
    
    Previously the terminating NUL wasn't copied which resulted
    in a compiler warning. This didn't cause actual problems as
    the target buffer was initialized by zalloc_or_die() so the
    last byte of the target buffer was NUL already.
    
    Actually copying the terminating NUL seems clearer, though.
    
    Reported by: Lee
---
 ssl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ssl.c b/ssl.c
index 18661547..afd9af45 100644
--- a/ssl.c
+++ b/ssl.c
@@ -1977,7 +1977,7 @@ static int *get_ciphersuites_from_string(const char *parameter_string)
    size_t parameter_len = strlen(parameter_string);
 
    ciphersuites_string = zalloc_or_die(parameter_len + 1);
-   strncpy(ciphersuites_string, parameter_string, parameter_len);
+   strlcpy(ciphersuites_string, parameter_string, parameter_len + 1);
    ciphersuites_index = ciphersuites_string;
 
    while (*ciphersuites_index)

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Privoxy-commits mailing list