Skip to content

Commit 82c01f6

Browse files
committed
refactor: update checking input size
1 parent ba56bc9 commit 82c01f6

File tree

1 file changed

+1
-6
lines changed
  • cvmassistants/quote-generator/src

1 file changed

+1
-6
lines changed

cvmassistants/quote-generator/src/main.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,7 @@ fn main() -> Result<(), QuoteGeneratorError> {
139139
let input = &args[1];
140140
let input_bytes = input.as_bytes();
141141
if input_bytes.len() > REPORT_DATA_SIZE {
142-
error!(
143-
"report_data must be at most {} bytes, got {} bytes",
144-
REPORT_DATA_SIZE,
145-
input_bytes.len()
146-
);
147-
process::exit(1);
142+
return Err(QuoteGeneratorError::ReportDataTooLarge { max: REPORT_DATA_SIZE, actual: input_bytes.len() });
148143
}
149144

150145
let mut report_bytes = [0u8; REPORT_DATA_SIZE];

0 commit comments

Comments
 (0)