Dynamic memory allocation for local buffer to avoid -Wframe-larger-than=1024 warning (risk of stack overflow)

Fix memset size.