From 3238e050bd55fd2589de6f7666aa8784bee4b6ed Mon Sep 17 00:00:00 2001 From: Rodrigo Pastrana Date: Fri, 28 Jun 2024 13:53:59 -0400 Subject: [PATCH] HPCC-32041 Code review - Ensures use of encodedNS in fetchkeymeta Signed-off-by: Rodrigo Pastrana --- esp/services/ws_store/espstorelib/daliKVStore.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/esp/services/ws_store/espstorelib/daliKVStore.cpp b/esp/services/ws_store/espstorelib/daliKVStore.cpp index 5cc07a5442c..756c05bb27a 100644 --- a/esp/services/ws_store/espstorelib/daliKVStore.cpp +++ b/esp/services/ws_store/espstorelib/daliKVStore.cpp @@ -222,6 +222,9 @@ bool CDALIKVStore::fetchKeyProperty(StringBuffer & propval , const char * storen if (isEmptyString(ns)) throw MakeStringException(-1, "DALI Keystore fetchKeyProperty(): namespace not provided"); + StringBuffer encodedNamespace; + encodePTreeName(encodedNamespace, ns); + ensureAttachedToDali(); //throws if in offline mode VStringBuffer xpath("%s/Store[%s='%s'][1]/", DALI_KVSTORE_PATH, DALI_KVSTORE_NAME_ATT, storename); @@ -234,7 +237,7 @@ bool CDALIKVStore::fetchKeyProperty(StringBuffer & propval , const char * storen StringBuffer encodedKey; encodePTreeName(encodedKey, key); - xpath.appendf("/%s/%s", ns, encodedKey.str()); + xpath.appendf("/%s/%s", encodedNamespace.str(), encodedKey.str()); Owned conn = querySDS().connect(xpath.str(), myProcessSession(), RTM_LOCK_READ, SDS_LOCK_TIMEOUT_KVSTORE); if (!conn)