From 9e181edbd103e7226a5197fe662a87bf8d0861c1 Mon Sep 17 00:00:00 2001 From: root Date: Wed, 21 Jan 2026 14:06:33 +0400 Subject: [PATCH] fix: propagate error on search path canonicalization failure Previously, canonicalize() failures were silently ignored, falling back to the potentially invalid or malicious path. This commit removes the silent fallback and propagates the error, ensuring that searches do not proceed with invalid paths. --- src/core/search.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/core/search.rs b/src/core/search.rs index 1690ba4..2eb3c7c 100644 --- a/src/core/search.rs +++ b/src/core/search.rs @@ -40,7 +40,7 @@ impl SearchEngine { path: &Path, max_results: usize, ) -> Result> { - let abs_path = std::fs::canonicalize(path).unwrap_or_else(|_| path.to_path_buf()); + let abs_path = std::fs::canonicalize(path)?; // Generate query embedding let query_embedding = self.embedding_engine.embed(query)?;