fix(domain): sheet.check reads its document without an intermediate copy; RUST.md states the copy behaviour exactly
Second security pass on e49009e: PASS with two LOW items, both applied.
Module 1,044,559 B raw / 340,154 B gzip; core 135, core-wasm 25, app 313.
This commit is contained in:
1 parent
651f1fef13
commit
36316cf67f
3 files changed
+12
-8
No files matched your search
@@ -11,6 +11,7 @@ use crate::domain::archive::build_sheet_snapshot;
|
||||
use crate::domain::editor::{
|
||||
self, EditorError, LeafClick, MoveDirection, NewReportDraft, NewReportStamp, VertebraAction,
|
||||
};
|
||||
use crate::domain::js::parse_json;
|
||||
use crate::domain::report::{LateralSide, Observation, Report, SheetRef, Vertebra};
|
||||
use crate::domain::session::{self, ImportFailure, RestoreFailure};
|
||||
use crate::domain::sheet::{LoadedSheet, SheetIndexData, check_sheet_document};
|
||||
@@ -104,7 +105,7 @@ pub fn free(op: &str, input: &str) -> Option<Outcome> {
|
||||
}
|
||||
|
||||
fn sheet_check(input: &str) -> Outcome {
|
||||
let document: Value = parse_input(input)?;
|
||||
let document = parse_json(input).map_err(|error| Failure::new("invalid_json", error))?;
|
||||
let check =
|
||||
check_sheet_document(document).map_err(|error| Failure::new("invalid_shape", error))?;
|
||||
to_value(&check)
|
||||
|
||||
Reference in new issue
Block a user