jketterl / digiham

tools for decoding digital ham communication
GNU General Public License v3.0
46 stars 14 forks source link

Possible off-by-one error in YSF decoder #3

Closed fventuri closed 3 years ago

fventuri commented 3 years ago

Jakob, I just noticed that in line 151 in ysf_decoder.c (https://github.com/jketterl/digiham/blob/develop/src/ysf_decoder/ysf_decoder.c#L151), you initialize eight elements for the result vector, while the length of the vector is only seven elements (see line 391).

I think it should be changed to something like this instead:

    for (int i = 0; i < 7; i++) result[i] = 0;

73, Franco

jketterl commented 3 years ago

Interesting. Yes, you're absolutely right. I'm surprised this has never triggered any errors when run with address sanitizer...

I will fix this, it has also been carried over to the csdr++ branch, so I'll have to do this in a smart way...

jketterl commented 3 years ago

So my merging strategy didn't work out... had to fix it manually. Should be fixed now :)