Skip to content
New issue

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

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

Already on GitHub? # to your account

Segfault when calling a method when this is null #106

Closed
jcmonnin opened this issue Mar 26, 2019 · 2 comments · Fixed by #107
Closed

Segfault when calling a method when this is null #106

jcmonnin opened this issue Mar 26, 2019 · 2 comments · Fixed by #107

Comments

@jcmonnin
Copy link
Contributor

jcmonnin commented Mar 26, 2019

See test case: jcmonnin/v8pp@8c9db45

When this doesn't reference the actual instance, v8pp resolves the unwarp to a nullptr and then calls the method on the null pointer which causes a segfault.

The script shouldn't be able to crash the host application, so I think there should be a runtime check that results in a JavaScript error.

Let me know if you prefer to have a full patch proposal instead of just this incomplete test case.

@pmed
Copy link
Owner

pmed commented Mar 26, 2019 via email

@jcmonnin
Copy link
Contributor Author

Hi Pavel,

I currently don't have a fix that is ready, but I can try to make one. I keep you updated.

jcmonnin added a commit to jcmonnin/v8pp that referenced this issue May 1, 2019
jcmonnin added a commit to jcmonnin/v8pp that referenced this issue May 1, 2019
jcmonnin added a commit to jcmonnin/v8pp that referenced this issue May 1, 2019
Previously this was giving a segfault

Fixes pmed#106
@pmed pmed closed this as completed in #107 May 3, 2019
pmed added a commit that referenced this issue May 3, 2019
pmed added a commit that referenced this issue May 3, 2019
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants