Skip to content

Commit ae0507d

Browse files
committed
handle load contents correctly
1 parent fc44e62 commit ae0507d

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
- fixed a bug with Dockerfile path resolution
99
- handle NetworkAccess Requirment in runner
1010
- inherit parents requirements correclty
11-
- ramping up runner conformance from 160/378 to 185/378
11+
- ramping up runner conformance from 160/378 to 186/378
1212

1313
# v0.5.2
1414
## 🐛 Bugfixes

crates/cwl-execution/src/environment.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ impl RuntimeEnvironment {
7878
);
7979

8080
let inputs = collect_inputs(tool, &input_values.inputs, tooldir)?;
81-
81+
8282
let mut environment = RuntimeEnvironment {
8383
runtime,
8484
time_limit: input_values.get_requirement::<ToolTimeLimit>().map(|tt| tt.timelimit).unwrap_or(0),
@@ -144,6 +144,9 @@ pub(crate) fn collect_inputs(
144144
let mut result_input = evaluate_input(input, input_values)?;
145145
if let DefaultValue::File(f) = &mut result_input {
146146
if input.load_contents {
147+
if fs::metadata(f.location.as_ref().expect("Could not read file"))?.len() > 64 * 1024 {
148+
return Err("File is too large to load contents (see: https://www.commonwl.org/v1.2/CommandLineTool.html#CommandInputParameter)".into());
149+
}
147150
f.contents = Some(fs::read_to_string(f.location.as_ref().expect("Could not read file"))?);
148151
}
149152
//load file meta

0 commit comments

Comments
 (0)