mirror of https://github.com/arendst/Tasmota.git
Berry fix potential crash when solidifying loaded bytecode (#21583)
This commit is contained in:
parent
a99c6d67bb
commit
d16a502f36
|
@ -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--) {
|
||||
|
|
Loading…
Reference in New Issue