string append more protection

This commit is contained in:
2024-05-13 22:29:22 +03:00
parent d764171c82
commit f97fed7daa
2 changed files with 2 additions and 1 deletions

View File

@@ -3,7 +3,7 @@ cmake_policy(SET CMP0017 NEW) # need include() with .cmake
project(PIP) project(PIP)
set(PIP_MAJOR 3) set(PIP_MAJOR 3)
set(PIP_MINOR 19) set(PIP_MINOR 19)
set(PIP_REVISION 0) set(PIP_REVISION 1)
set(PIP_SUFFIX ) set(PIP_SUFFIX )
set(PIP_COMPANY SHS) set(PIP_COMPANY SHS)
set(PIP_DOMAIN org.SHS) set(PIP_DOMAIN org.SHS)

View File

@@ -300,6 +300,7 @@ void PIString::appendFromChars(const char * c, int s, const char * codepage) {
if (s == 0) return; if (s == 0) return;
int old_sz = size_s(); int old_sz = size_s();
if (s == -1) s = strlen(c); if (s == -1) s = strlen(c);
if (s <= 0) return;
#ifdef PIP_ICU #ifdef PIP_ICU
UErrorCode e((UErrorCode)0); UErrorCode e((UErrorCode)0);
UConverter * cc = ucnv_open(codepage, &e); UConverter * cc = ucnv_open(codepage, &e);