Berry fix potential crash when solidifying loaded bytecode (#21583)

This commit is contained in:
s-hadinger 2024-06-06 22:11:52 +02:00 committed by GitHub
parent a99c6d67bb
commit d16a502f36
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 2 additions and 2 deletions

View File

@ -524,8 +524,8 @@ static void load_proto_table(bvm *vm, void *fp, bproto *proto, int info, int ver
{
int size = (int)load_long(fp); /* proto count */
if (size) {
bproto **p = be_malloc(vm, sizeof(bproto *) * size);
memset(p, 0, sizeof(bproto *) * size);
bproto **p = be_malloc(vm, sizeof(bproto *) * (size + 1));
memset(p, 0, sizeof(bproto *) * (size + 1));
proto->ptab = p;
proto->nproto = size;
while (size--) {