Skip to content

Fix no shx negative record size mem leak - #455

Merged
JamesParrott merged 4 commits into
GeospatialPython:masterfrom
JamesParrott:Fix_no_Shx_negative_record_size_mem_leak
Nov 6, 2026
Merged

JamesParrott merged 4 commits into
GeospatialPython:masterfrom
JamesParrott:Fix_no_Shx_negative_record_size_mem_leak

Conversation

@JamesParrott

Copy link
Copy Markdown
Collaborator

Fixes #453

I also added end-of-file-checker to pre-commit, so this PR hits a lot of other files with trivial changes

JamesParrott and others added 4 commits November 6, 2026 16:04
Reproduces issue 453

Overwrite record length with -4 (16bw) to make header+len == 0

seek(0) before corrupting shape record length

Switch LE to BE (correct the type of corruption we want!)

Co-Authored-By: lunuyennhi-dev <325280363+lunuyennhi-dev@users.noreply.github.com>
Renamed the exception as the shape type is technically in the record

Don't raise CorruptShpShapeRecord on a Null Shape

body, not the header.reproduces issue 453

Co-authored-by: lunuyennhi-dev <325280363+lunuyennhi-dev@users.noreply.github.com>
@JamesParrott
JamesParrott merged commit d8c61cf into GeospatialPython:master Nov 6, 2026
36 of 39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

len(Reader(...)) hangs forever and leaks memory on a shapefile with a negative record length

1 participant