Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong trim causes array out of bounds #12

Closed
diablowu opened this issue Sep 30, 2022 · 1 comment
Closed

Wrong trim causes array out of bounds #12

diablowu opened this issue Sep 30, 2022 · 1 comment

Comments

@diablowu
Copy link
Contributor

diablowu commented Sep 30, 2022

Description:
If there are blank characters in the field content, for example: <comment:3>C: <eor>,adifreader.go#ReadRecord will be panic.

Panic:

panic: runtime error: slice bounds out of range [3:2] [recovered]
	panic: runtime error: slice bounds out of range [3:2]

......................

	<Path>/vendor/github.com/Matir/adifparser/adifrecord.go:119 +0x528
github.com/Matir/adifparser.ParseADIFRecord({0xc0000f2400, 0xd, 0x400})
	<Path>/vendor/github.com/Matir/adifparser/adifrecord.go:69 +0x18e
github.com/Matir/adifparser.(*baseADIFReader).ReadRecord(0xc0000d0b00)
	<Path>/vendor/github.com/Matir/adifparser/adifreader.go:51 +0x105

Possible problems:
https://github.com/Matir/adifparser/blob/master/adifreader.go#L166

VY 73 DE BI1NIZ

diablowu added a commit to diablowu/adifparser that referenced this issue Sep 30, 2022
@Matir
Copy link
Owner

Matir commented Oct 3, 2022

Thanks for the bug report, I'll take a look at this.

@Matir Matir closed this as completed in 0cd0e28 Oct 3, 2022
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

No branches or pull requests

2 participants