Skip to content

Conversation

@ihsanbudiman
Copy link
Contributor

@ihsanbudiman ihsanbudiman commented Jan 22, 2026

hi @twpayne thanks for the lib
but there is issue on scanner when dbf error it cause panic.

Changes

  • Add early returns in NewScanner goroutines to prevent execution continuation after errors
  • Fix panic in NewScannerDBF where nil scanner header was accessed on error
  • Ensure consistent error handling across SHP, DBF, and SHX scanner initialization

How to reproduce:

  • i try parsing shapefile with invalid dbf file, for example i use csv file then change it into .dbf just to test it when i upload invalid dbf file
image

## Changes

- Add early returns in NewScanner goroutines to prevent execution continuation after errors

- Fix panic in NewScannerDBF where nil scanner header was accessed on error

- Ensure consistent error handling across SHP, DBF, and SHX scanner initialization
@twpayne
Copy link
Owner

twpayne commented Jan 22, 2026

Thank you for the PR. There is still a race in the code, which I will fix in a follow-up PR.

@twpayne twpayne merged commit d900679 into twpayne:master Jan 22, 2026
3 checks passed
@twpayne
Copy link
Owner

twpayne commented Jan 22, 2026

I've tagged v0.0.7 which includes this fix.

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.

3 participants