[Openvpn-devel] [PATCH] buffer: use memcpy in buf_catrunc

2023-09-22 Thread Frank Lichtenheld
Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the length of strncpy which is usually a sign for bugs: error: ‘strncpy’ specified bound depends on the len

Re: [Openvpn-devel] [PATCH] buffer: use memcpy in buf_catrunc

2023-03-28 Thread Matthias Andree
Am 28.03.23 um 20:58 schrieb Antonio Quartulli: Hi, On 28/03/2023 20:51, Matthias Andree wrote: Am 28.03.23 um 17:12 schrieb Frank Lichtenheld: Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain

Re: [Openvpn-devel] [PATCH] buffer: use memcpy in buf_catrunc

2023-03-28 Thread Antonio Quartulli
Hi, On 28/03/2023 20:51, Matthias Andree wrote: Am 28.03.23 um 17:12 schrieb Frank Lichtenheld: Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the lengt

Re: [Openvpn-devel] [PATCH] buffer: use memcpy in buf_catrunc

2023-03-28 Thread Matthias Andree
Am 28.03.23 um 17:12 schrieb Frank Lichtenheld: Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the length of strncpy which is usually a sign for bugs: er

Re: [Openvpn-devel] [PATCH] buffer: use memcpy in buf_catrunc

2023-03-28 Thread Antonio Quartulli
Hi, On 28/03/2023 17:12, Frank Lichtenheld wrote: Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the length of strncpy which is usually a sign for bugs:

[Openvpn-devel] [PATCH] buffer: use memcpy in buf_catrunc

2023-03-28 Thread Frank Lichtenheld
Since we use strlen() to determine the length and then check it ourselves, there is really no point in using strncpy. But the compiler might complain that we use the output of strlen() for the length of strncpy which is usually a sign for bugs: error: ‘strncpy’ specified bound depends on the len