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

Non-null terminated strings are being passed to CompileOptionsWrapper::new #27355

Closed
jdm opened this issue Jul 22, 2020 · 1 comment
Closed

Non-null terminated strings are being passed to CompileOptionsWrapper::new #27355

jdm opened this issue Jul 22, 2020 · 1 comment

Comments

@jdm
Copy link
Member

@jdm jdm commented Jul 22, 2020

unsafe { CompileOptionsWrapper::new(*cx, final_url.as_str().as_ptr() as *const i8, 1) };

We need to convert the rust string into a CString before passing the pointer to it.

@jdm
Copy link
Member Author

@jdm jdm commented Jul 22, 2020

Filed servo/rust-mozjs#518 about preventing this in the future.

@jdm jdm self-assigned this Jul 22, 2020
bors-servo added a commit that referenced this issue Jul 22, 2020
Fixes for off-thread compilation of scripts

Fixes #27355. Fixes #27349.
bors-servo added a commit that referenced this issue Jul 22, 2020
Fixes for off-thread compilation of scripts

Fixes #27355. Fixes #27349.
bors-servo added a commit that referenced this issue Jul 22, 2020
Fixes for off-thread compilation of scripts

Fixes #27355. Fixes #27349.
bors-servo added a commit that referenced this issue Jul 22, 2020
Fixes for off-thread compilation of scripts

Fixes #27355. Fixes #27349.
bors-servo added a commit that referenced this issue Jul 22, 2020
Fixes for off-thread compilation of scripts

Fixes #27355. Fixes #27349.
bors-servo added a commit that referenced this issue Jul 23, 2020
Fixes for off-thread compilation of scripts

Fixes #27355. Fixes #27349.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

1 participant
You can’t perform that action at this time.