From a87f83bff081b964d0cb89a88dca9e0f95b727ac Mon Sep 17 00:00:00 2001 From: yihaoDeng Date: Tue, 8 Jun 2021 15:34:36 +0800 Subject: [PATCH] [TD-4521] --- src/os/src/detail/osString.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/os/src/detail/osString.c b/src/os/src/detail/osString.c index 2c49797d83..fdc70b667e 100644 --- a/src/os/src/detail/osString.c +++ b/src/os/src/detail/osString.c @@ -59,6 +59,9 @@ bool taosMbsToUcs4(char *mbs, size_t mbsLength, char *ucs4, int32_t ucs4_max_len iconv_close(cd); if (len != NULL) { *len = (int32_t)(ucs4_max_len - outLeft); + if (*len < 0) { + return false; + } } return true; -- GitLab