From 2b01ab1b1522659432fb67b024f8fa313b4f0093 Mon Sep 17 00:00:00 2001 From: Denis Khalikov Date: Thu, 23 Nov 2023 15:37:37 +0300 Subject: [PATCH] fix(primproc,stringstore): MCOL-5597 Set length for `nullptr` string to 0. (#3034) --- utils/common/conststring.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/utils/common/conststring.h b/utils/common/conststring.h index 6813cee0a..021529bf5 100644 --- a/utils/common/conststring.h +++ b/utils/common/conststring.h @@ -33,7 +33,8 @@ class ConstString public: ConstString(const char* str, size_t length) : mStr(str), mLength(length) { - idbassert(mStr || mLength == 0); // nullptr mStr should have zero length. + if (!mStr) + mLength = 0; } explicit ConstString(const std::string& str) : mStr(str.data()), mLength(str.length()) {