ggerganov / ggwave

Tiny data-over-sound library
https://youtu.be/Zcgf77T71QM
MIT License
1.9k stars 141 forks source link

Fix out-of-bounds access in ggwave_decode #53

Closed ggerganov closed 2 years ago

ggerganov commented 2 years ago

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.

gizahNL commented 2 years ago

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 commented 2 years ago

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!