提交 eb1ac0ce 编写于 作者: K Kevin Heifner

Change unpack_action_data to use max stack buffer of 128

上级 9e7a7608
......@@ -44,8 +44,10 @@ namespace eosio {
*/
template<typename T>
T unpack_action_data() {
char buffer[action_data_size()];
read_action_data( buffer, sizeof(buffer) );
constexpr size_t max_stack_buffer_size = 128;
size_t size = action_data_size();
char* buffer = (char*)( max_stack_buffer_size < size ? malloc(size) : alloca(size) );
read_action_data( buffer, size );
return unpack<T>( buffer, sizeof(buffer) );
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册