Skip to content

Commit

Permalink
Limit code size to 64K
Browse files Browse the repository at this point in the history
  • Loading branch information
learnforpractice committed Oct 18, 2018
1 parent 0ac9a64 commit 0cd6bbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion libraries/chain/vm_api_native/vm_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,9 @@ bool check_code_auth(uint64_t account, uint64_t code_account, uint64_t code_name
int set_code_ext(uint64_t account, int vm_type, uint64_t code_name, const char* src_code, size_t code_size) {
int result_size = 0;
const char* compiled_code;

if (code_size >= 64*1024) {
eosio_assert(false, "code size exceed the limit of 64K!");
}
get_vm_api()->require_auth(account);

if (vm_type == VM_TYPE_PY) {
Expand Down

0 comments on commit 0cd6bbb

Please sign in to comment.