mirror of
https://github.com/arendst/Tasmota.git
synced 2025-07-24 11:16:34 +00:00
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 */
|
int size = (int)load_long(fp); /* proto count */
|
||||||
if (size) {
|
if (size) {
|
||||||
bproto **p = be_malloc(vm, sizeof(bproto *) * size);
|
bproto **p = be_malloc(vm, sizeof(bproto *) * (size + 1));
|
||||||
memset(p, 0, sizeof(bproto *) * size);
|
memset(p, 0, sizeof(bproto *) * (size + 1));
|
||||||
proto->ptab = p;
|
proto->ptab = p;
|
||||||
proto->nproto = size;
|
proto->nproto = size;
|
||||||
while (size--) {
|
while (size--) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user