From 2c0f08e2a62d2f46e1cd86da1b6abe451263070b Mon Sep 17 00:00:00 2001 From: Daniel Caujolle-Bert Date: Thu, 10 Aug 2023 08:08:06 +0200 Subject: [PATCH] Fix memcpy overflow, as src and dest are 32 bytes long, only 31 bytes has to be copied, not 32, since an offset is applied to src. --- DMRTA.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/DMRTA.cpp b/DMRTA.cpp index 055116ea..94ecbaf5 100644 --- a/DMRTA.cpp +++ b/DMRTA.cpp @@ -98,7 +98,7 @@ bool CDMRTA::decodeTA() case 1U: // ISO 8 bit case 2U: // UTF8 - ::memcpy(m_ta, m_buf + 1U, sizeof(m_ta)); + ::memcpy(m_ta, m_buf + 1U, sizeof(m_ta) - 1); break; case 3U: { // UTF16 poor man's conversion