Skip to content

Bus error if 'offset' of mmap is greater than 2gb. #31

@peekpi

Description

@peekpi

js code to reproduce:

...
const mmap = require("mmap-io")
const fd = ... // openSync, ftruncateSync, etc
const buf = mmap.map(mmap.PAGESIZE, mmap.PROT_WRITE | mmap.PROT_READ,  mmap.MAP_SHARED, fd, 0x80000000);
console.log(buf); // will cause bus error;
...

The possible reason is the use of int:

const size_t offset = static_cast<size_t>(get_v<int>(info[4], 0));

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions