From 56801e20da1135da678488a66b248aca2aab6b36 Mon Sep 17 00:00:00 2001 From: ChrisCoxArt Date: Sun, 22 Feb 2026 17:03:21 -0800 Subject: [PATCH] include NULL in size of string Fixes #609 --- IccProfLib/IccTagBasic.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/IccProfLib/IccTagBasic.cpp b/IccProfLib/IccTagBasic.cpp index 5f813457a..ecd6b5ded 100644 --- a/IccProfLib/IccTagBasic.cpp +++ b/IccProfLib/IccTagBasic.cpp @@ -2326,12 +2326,12 @@ const icChar *CIccTagTextDescription::operator=(const icChar *szText) */ icChar *CIccTagTextDescription::GetBuffer(icUInt32Number nSize) { - if (m_nASCIISize < nSize) { - m_szText = (icChar*)icRealloc(m_szText, nSize+1); + if (m_nASCIISize < (nSize+1)) { + m_szText = (icChar*)icRealloc(m_szText, (nSize+1)); m_szText[nSize] = '\0'; - m_nASCIISize = nSize; + m_nASCIISize = (nSize+1); // include NULL termination! } return m_szText;