about summary refs log tree commit diff
diff options
context:
space:
mode:
authorFlorian Klink <flokli@flokli.de>2024-01-05T11·43+0200
committerclbot <clbot@tvl.fyi>2024-01-05T16·43+0000
commit8e794478bf181b79f54f9a71ff329da5c9c43b29 (patch)
treeaa8b71ffc8943b28d9185a6cc4145fbd48044eea
parent6b42aef88d80b7e65240ffc21597cf719e811c55 (diff)
feat(tvix/store/pathinfosvc): call validate r/7348
Change-Id: I557ed67a04112ba3e363303637d1988309250a93
Reviewed-on: https://cl.tvl.fyi/c/depot/+/10535
Tested-by: BuildkiteCI
Autosubmit: flokli <flokli@flokli.de>
Reviewed-by: raitobezarius <tvl@lahfa.xyz>
-rw-r--r--tvix/store/src/pathinfoservice/grpc.rs10
1 files changed, 9 insertions, 1 deletions
diff --git a/tvix/store/src/pathinfoservice/grpc.rs b/tvix/store/src/pathinfoservice/grpc.rs
index f05fe2c04d43..4ec1467525f9 100644
--- a/tvix/store/src/pathinfoservice/grpc.rs
+++ b/tvix/store/src/pathinfoservice/grpc.rs
@@ -38,7 +38,15 @@ impl PathInfoService for GRPCPathInfoService {
             .await;
 
         match path_info {
-            Ok(path_info) => Ok(Some(path_info.into_inner())),
+            Ok(path_info) => {
+                let path_info = path_info.into_inner();
+
+                path_info
+                    .validate()
+                    .map_err(|e| Error::StorageError(format!("invalid pathinfo: {}", e)))?;
+
+                Ok(Some(path_info))
+            }
             Err(e) if e.code() == Code::NotFound => Ok(None),
             Err(e) => Err(Error::StorageError(e.to_string())),
         }