shinyquagsire23 / OpenJKDF2

A cross-platform reimplementation of JKDF2 in C
Other
513 stars 43 forks source link

Missing va_start/va_end wrapping in stdPlatform_Printf? #213

Closed thecom closed 1 year ago

thecom commented 1 year ago

OpenJKDF2 crashed randomly for me. I think I traced the error to stdPlatform_Printf(). There both vprintf() and vsnprintf() seem to consume the variadic arguments. If I insert va_end(args); va_start(args, fmt); between both calls, the crashes stop.

I'm no C expert, does this make sense?

shinyquagsire23 commented 1 year ago

Oh I actually just fixed this last night, it caused a crash on x86_64 Linux specifically for some reason

shinyquagsire23 commented 1 year ago

Specifically though, bca3d9873538ab76dcfa64277c9fc243990b3ed2

thecom commented 1 year ago

Awesome, fix confirmed. Thanks a lot!