Message ID | 20230922160441.167168-1-frank@lichtenheld.com |
---|---|
State | Accepted |
Headers | show |
Series | [Openvpn-devel] buffer: use memcpy in buf_catrunc | expand |
Straightforward cherrypick, smoke tested on linux. Your patch has been applied to the release/2.6 branch. commit 946219115d00c6ae658afcf538249e721e6bd600 (release/2.6) Author: Frank Lichtenheld Date: Fri Sep 22 18:04:41 2023 +0200 buffer: use memcpy in buf_catrunc Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com> Acked-by: Antonio Quartulli <a@unstable.cc> Acked-by: Heiko Hund <heiko@openvpn.net> Acked-by: Gert Doering <gert@greenie.muc.de> Message-Id: <20230922160441.167168-1-frank@lichtenheld.com> URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg27085.html Signed-off-by: Gert Doering <gert@greenie.muc.de> -- kind regards, Gert Doering
diff --git a/src/openvpn/buffer.c b/src/openvpn/buffer.c index d099795..7725438 100644 --- a/src/openvpn/buffer.c +++ b/src/openvpn/buffer.c @@ -316,10 +316,10 @@ { if (buf_forward_capacity(buf) <= 1) { - int len = (int) strlen(str) + 1; + size_t len = strlen(str) + 1; if (len < buf_forward_capacity_total(buf)) { - strncpynt((char *)(buf->data + buf->capacity - len), str, len); + memcpy(buf->data + buf->capacity - len, str, len); } } }