I found a stack buffer overflow in SyroComp_CompBlock that didn't seem to result in any bugs when I compiled code with GCC.. however I consistently ran into problems when compiling to WebAssembly with Emscripten.
We can see that once j has been incremented to 4, the index 4 of BitBase (which doesn't exist) will be checked for the remainder of the loop. If the out of bounds memory happens to match i by accident, then we will get a false positive and write incorrect data.
Adding the index guard in this pull request solves the problem and makes my tests pass (for both GCC and Emscripten).
Closes #18.
I found a stack buffer overflow in SyroComp_CompBlock that didn't seem to result in any bugs when I compiled code with GCC.. however I consistently ran into problems when compiling to WebAssembly with Emscripten.
In this code:
https://github.com/korginc/volcasample/blob/b0ed615f18c230a18b378d9ddc6a936971597e4e/syro/korg_syro_comp.c#L394-L403
We can see that once
j
has been incremented to 4, the index 4 ofBitBase
(which doesn't exist) will be checked for the remainder of the loop. If the out of bounds memory happens to matchi
by accident, then we will get a false positive and write incorrect data.Adding the index guard in this pull request solves the problem and makes my tests pass (for both GCC and Emscripten).