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

Protect TypedArray::from method against null pointers #334

Merged
merged 1 commit into from Feb 6, 2017

Conversation

@zakorgy
Copy link
Contributor

zakorgy commented Feb 6, 2017

Fixes #332. Also added a test as described in the issue.


This change is Reviewable

@emilio
emilio approved these changes Feb 6, 2017
Copy link
Member

emilio left a comment

One nit, the rest looks great, thanks for working on this! :)

@@ -70,6 +70,9 @@ impl<'a, T: TypedArrayElement> TypedArray<'a, T> {
root: &'a mut Rooted<*mut JSObject>,
object: *mut JSObject)
-> Result<Self, ()> {
if object == ptr::null_mut() {

This comment has been minimized.

@emilio

emilio Feb 6, 2017

Member

nit: deindent four spaces, and use if object.is_null() instead.

@emilio
Copy link
Member

emilio commented Feb 6, 2017

Perfect! Please squash the commit (bors doesn't do that automatically), and this is good to merge :)

@zakorgy zakorgy force-pushed the zakorgy:typedarray branch from df63b78 to 4cfdfb9 Feb 6, 2017
@KiChjang
Copy link
Member

KiChjang commented Feb 6, 2017

@bors-servo r=emilio

@bors-servo
Copy link
Contributor

bors-servo commented Feb 6, 2017

📌 Commit 4cfdfb9 has been approved by emilio

@bors-servo
Copy link
Contributor

bors-servo commented Feb 6, 2017

Testing commit 4cfdfb9 with merge 372d6c1...

bors-servo added a commit that referenced this pull request Feb 6, 2017
Protect TypedArray::from method against null pointers

Fixes #332. Also added a test as described in the issue.

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/rust-mozjs/334)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Feb 6, 2017

☀️ Test successful - status-appveyor, status-travis
Approved by: emilio
Pushing 372d6c1 to master...

@bors-servo bors-servo merged commit 4cfdfb9 into servo:master Feb 6, 2017
2 checks passed
2 checks passed
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

4 participants
You can’t perform that action at this time.