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

Fix out-of-bounds access in ggwave_decode #53

Merged

Conversation

ggerganov
Copy link
Owner

@ggerganov ggerganov commented Sep 19, 2021

ref #50

Also, provide a memory-safe overload called ggwave_ndecode()
The overload takes an extra parameter that specifies the size of
the output buffer and thus limits the size of the Rx payload that can be
decoded and stored.

@ggerganov ggerganov linked an issue Sep 19, 2021 that may be closed by this pull request
@ggerganov ggerganov force-pushed the ggwave/fix-ggwave_decode-out-of-bounds-access-issue-50 branch from e2177b0 to f7c38d8 Compare September 19, 2021 09:05
@gizahNL
Copy link

gizahNL commented Sep 19, 2021

Would it be possible to drop the nullbyte when using _ndecode? Our usecase (ideally) involves providing the address of a struct and a sizeof the struct, in our usecase _ndecode would never work.

@ggerganov
Copy link
Owner Author

Yes, actually that makes more sense now that I think about it.
Will change ggwave_ndecode to not add the null byte at the end.
Thanks for the suggestions!

@ggerganov ggerganov force-pushed the ggwave/fix-ggwave_decode-out-of-bounds-access-issue-50 branch 2 times, most recently from 98c62ba to 7ee159a Compare September 21, 2021 03:59
Also, provide a memory-safe overload called ggwave_ndecode()
The overload takes an extra parameter that specifies the size of
the output buffer and thus limits the size of the Rx payload that can be
decoded and stored.
@ggerganov ggerganov force-pushed the ggwave/fix-ggwave_decode-out-of-bounds-access-issue-50 branch from 7ee159a to 1e10c18 Compare September 21, 2021 04:01
@ggerganov ggerganov merged commit 43bf2f1 into master Sep 21, 2021
@ggerganov ggerganov deleted the ggwave/fix-ggwave_decode-out-of-bounds-access-issue-50 branch September 21, 2021 04:07
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.

C library ggwave_decode, no bounds checking
2 participants