Den 22.12.2010 10:21, skrev Vincent Rivière:
Jo Even Skarstein wrote:This particular problem must be fixed in CF-Lib. Instead of putting the arrays on the stack, they should be Malloc-ed.The arrays are currently allocated on the stack inside the GemLib (not CF-Lib), for example inside v_gtext().
Really? I don't use GEMlib, I use PureC with the ancient, original aes-lib... The parameter-arrays in that lib are global, so no problem there.
Yes, as long as the code is intended to run on anything else than XaAES and be usable in a multithreaded application. However, I like Andreas Kromke's solution better. He introduced a thread-safe AES/VDI-lib when MagiC got threads - this library has mt_-versions of all calls. These calls have an extra parameter, where the calling application passes a pointer to the parameter blocks. So it's thread-safe (as long as the calling application reserves unique parameter blocks for each thread!) but with no need for costly (de)allocations in the bindings.So malloc() seems to be the only safe solution...
Jo Even