diff --git a/src/client/src/tscParseInsert.c b/src/client/src/tscParseInsert.c index 23c3b07284d6fffece617636304b6aef2a676ab5..985fa588a488ae806a1752f046d2b16f209b14e0 100644 --- a/src/client/src/tscParseInsert.c +++ b/src/client/src/tscParseInsert.c @@ -312,6 +312,10 @@ int32_t tsParseOneColumnData(SSchema *pSchema, SSQLToken *pToken, char *payload, } strncpy(payload, pToken->z, pToken->n); + + if (pToken->n < pSchema->bytes) { + payload[pToken->n] = 0; // add the null-terminated char if the length of the string is shorter than the available space + } } break;