Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/2632 luaccrash #2661

Merged
merged 1 commit into from
Feb 12, 2019
Merged

Conversation

ziggurat29
Copy link
Contributor

Fixes #2632 .

  • This PR is for the dev branch rather than for master.
  • This PR is compliant with the other contributing guidelines as well (if not, please describe why).
  • I have thoroughly tested my contribution.
  • The code changes are reflected in the documentation at docs/en/*. ??? I see no such path.

A block of memory is accessed after having been freed. This was obscured by the fact that 'oBuf' is a pointer into the middle of the block 'dynamicTables', so when dynamicTables is freed, oBuf is pointing to freed memory. Occasionally, luac.cross would crash because of this.

…red by the fact that 'oBuf' is a pointer into the middle of the block 'dynamicTables', so when dynamicTables is freed, oBuf is pointing to freed memory. Occasionally, luac.cross would crash because of this.
@ziggurat29 ziggurat29 changed the base branch from master to dev February 11, 2019 18:01
@marcelstoer marcelstoer added this to the Next release milestone Feb 11, 2019
@marcelstoer marcelstoer merged commit 0c7758a into nodemcu:dev Feb 12, 2019
@ziggurat29 ziggurat29 deleted the bugfix/2632-luaccrash branch February 12, 2019 21:49
@TerryE
Copy link
Collaborator

TerryE commented Feb 14, 2019

Looking at the code, you can see that at about line 224:

 oBuf          = (struct outputBuf *)(dt+1);

so, oBuf is pointing /into/ the dt chunk. Also note, dt is an alias of dynamicTables.

Uuuuaaaargghhh @ziggurat29. Mea cupla; mea culpa.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants