lxy-9602 commented on code in PR #264:
URL: https://github.com/apache/paimon-cpp/pull/264#discussion_r3892968497


##########
src/paimon/core/catalog/file_system_catalog.cpp:
##########
@@ -511,6 +522,7 @@ Status FileSystemCatalog::RenameTable(const Identifier& 
from_table, const Identi
 
 Result<std::vector<SnapshotInfo>> FileSystemCatalog::ListSnapshots(
     const Identifier& identifier, const std::string& branch) const {
+    PAIMON_RETURN_NOT_OK(CatalogUtils::CheckValidBranchName(branch));
     PAIMON_ASSIGN_OR_RAISE(bool exists, TableExists(identifier));

Review Comment:
   **Branch validation does not cover all filesystem entry points**
   
   This validation only protects `FileSystemCatalog::ListSnapshots` and branch 
names encoded in catalog identifiers. Other public branch inputs, including 
`ReadContextBuilder::WithBranch`, `WriteContextBuilder::WithBranch`, 
`Options::BRANCH`, and `SCAN_FALLBACK_BRANCH`, are still passed to 
`BranchManager::BranchPath` without path-safety validation.
   
   For example, if a valid `rt` branch already exists, a branch value such as 
`rt/../../../../../outside` produces an invalid path.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to