Skip to content

WASM in grapheme_iterator causing integer underflow #109

Closed
@GnomedDev

Description

@GnomedDev

Describe the bug
The subtraction at the below line is underflowing with a super large file.

Some((unsafe { &*ptr::slice_from_raw_parts(ptr.add(start), cursor - start) }, found))

To Reproduce
Steps to reproduce the behavior:

  1. Download and extract https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/planet/replication/day/000/004/543.osc.gz
  2. Parse the file with the OpenTag event enabled.
  3. Wait for crash.

Expected behavior
Underflow does not occur, file parses correctly.

Desktop (please complete the following information):

  • OS: Linux
  • Browser: Chromium 133.0.6943.98

Additional context
I am testing on a branch with #108 fixed by bumping the offset to 1024, and may be able to provide a smaller reproduction later.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions