Fix "Unprotected use of alloca"
Fix read overrun
Fix using uninitialized memory