porres / pd-else

ELSE - EL Locus Solus' Externals for Pure Data
Do What The F*ck You Want To Public License
291 stars 36 forks source link

Fix buffer overflow in buffer.c #2098

Closed timothyschoen closed 3 months ago

timothyschoen commented 3 months ago

This fix is needed to make sure i+1 doesn't go past buffer bounds. In case i == ELSE_FADE_TABSIZE, i+1 will read out of array bounds. In this case, its value won't be used because frac will be zero, so it's fine to just set it to the same value as i.

porres commented 3 months ago

thanks, cyclone doens't need anything related?

timothyschoen commented 3 months ago

Oh possibly! I just made a test version of plugdata that opens every single helpfile automatically. So with AddressSanitizer enabled, I can find every memory bug! So far, I've found 3 bugs in ELSE (more PRs coming probably), and 2 in pure-data, both reported.

So far, I haven't seen any problems in cyclone, but I'll send PRs if I find anything