diff --git a/utils/funcexp/func_reverse.cpp b/utils/funcexp/func_reverse.cpp index edbedf183..edda9cab6 100644 --- a/utils/funcexp/func_reverse.cpp +++ b/utils/funcexp/func_reverse.cpp @@ -64,6 +64,7 @@ std::string Func_reverse::getStrVal(rowgroup::Row& row, const char* end = pos + binLen; char* pbuf = new char[binLen + 1]; + pbuf[binLen] = 0; char* tmp = pbuf + binLen; if (cs->use_mb()) // uses multi-byte characters