mirror of https://github.com/arendst/Tasmota.git
Berry fixed a rare condition when a GC causes a memory corruption (#18614)
This commit is contained in:
parent
c5e6115597
commit
4cd1136f4c
|
@ -23,6 +23,7 @@ All notable changes to this project will be documented in this file.
|
|||
|
||||
### Fixed
|
||||
- Partition_Manager.tapp fixed
|
||||
- Berry fixed a rare condition when a GC causes a memory corruption
|
||||
|
||||
### Removed
|
||||
|
||||
|
|
|
@ -195,6 +195,9 @@ static bstring* newshortstr(bvm *vm, const char *str, size_t len)
|
|||
}
|
||||
s = createstrobj(vm, len, 0);
|
||||
if (s) {
|
||||
/* recompute size and list that may have changed due to a GC */
|
||||
size = vm->strtab.size;
|
||||
list = vm->strtab.table + (hash & (size - 1));
|
||||
memcpy(cast(char *, sstr(s)), str, len);
|
||||
s->extra = 0;
|
||||
s->next = cast(void*, *list);
|
||||
|
|
Loading…
Reference in New Issue