Skip to content

Commit

Permalink
HPCC-32041 Code review
Browse files Browse the repository at this point in the history
- Ensures use of encodedNS in fetchkeymeta

Signed-off-by: Rodrigo Pastrana <[email protected]>
  • Loading branch information
rpastrana committed Jun 28, 2024
1 parent 52f90db commit 3238e05
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion esp/services/ws_store/espstorelib/daliKVStore.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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<IRemoteConnection> conn = querySDS().connect(xpath.str(), myProcessSession(), RTM_LOCK_READ, SDS_LOCK_TIMEOUT_KVSTORE);
if (!conn)
Expand Down

0 comments on commit 3238e05

Please sign in to comment.