MCPcopy Create free account
hub / github.com/microsoft/SandDance / checkOffset

Function checkOffset

docs/app/js/sanddance-app.js:113591–113594  ·  view source on GitHub ↗
(offset, ext, length)

Source from the content-addressed store, hash-verified

113589/*
113590 * Need to make sure that buffer isn't trying to write out of bounds.
113591 */ function checkOffset(offset, ext, length) {
113592 if (offset % 1 !== 0 || offset < 0) throw new RangeError("offset is not uint");
113593 if (offset + ext > length) throw new RangeError("Trying to access beyond buffer length");
113594}
113595Buffer.prototype.readUintLE = Buffer.prototype.readUIntLE = function readUIntLE(offset, byteLength1, noAssert) {
113596 offset = offset >>> 0;
113597 byteLength1 = byteLength1 >>> 0;

Callers 1

sanddance-app.jsFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected