MCPcopy Create free account
hub / github.com/Snapchat/Valdi / outOfBOundsLoad

Function outOfBOundsLoad

valdi_core/src/valdi_core/cpp/Utils/DiskUtils.cpp:71–77  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71static Error outOfBOundsLoad(const std::string& pathStr, size_t byteOffset, size_t toReadSize, size_t fileSize) {
72 return Error(STRING_FORMAT("Out of bounds read {} (asked byte offest {} with size {}, file size is {})",
73 pathStr,
74 byteOffset,
75 toReadSize,
76 fileSize));
77}
78
79Result<BytesView> FileReader::read(size_t byteOffset, std::optional<size_t> size) {
80 size_t toReadSize = size.has_value() ? size.value() : _fileSize;

Callers 1

readMethod · 0.85

Calls 1

ErrorClass · 0.70

Tested by

no test coverage detected