Skip to content

Commit

Permalink
Merge pull request #4968 from robhoes/xsi1423
Browse files Browse the repository at this point in the history
CA-376448: explicitly validate refs in PVS_cache_storage.create
  • Loading branch information
robhoes authored Apr 18, 2023
2 parents f354373 + 2456167 commit a637bc3
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions ocaml/xapi/xapi_pvs_cache_storage.ml
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ let assert_not_already_present ~__context site host =
api_error E.pvs_cache_storage_already_present [str site; str host]

let create ~__context ~host ~sR ~site ~size =
Helpers.assert_is_valid_ref ~__context ~name:"host" ~ref:host ;
Helpers.assert_is_valid_ref ~__context ~name:"SR" ~ref:sR ;
Helpers.assert_is_valid_ref ~__context ~name:"site" ~ref:site ;
assert_not_already_present ~__context site host ;
let cache_storage = Ref.make () in
let uuid = Uuidx.(to_string (make ())) in
Expand Down

0 comments on commit a637bc3

Please sign in to comment.