diff options
author | bors-servo <metajack+bors@gmail.com> | 2014-09-29 09:57:27 -0600 |
---|---|---|
committer | bors-servo <metajack+bors@gmail.com> | 2014-09-29 09:57:27 -0600 |
commit | a58324f25b6f87d005026d8f9405c9f0d89a1f74 (patch) | |
tree | fa1e824fb3c4d27926bfab7921dc1498350635a8 /components/script/dom/xmlhttprequest.rs | |
parent | e70dcc3ae55c743bab2aa4b35cbfd8dcf11f799a (diff) | |
parent | e72b5613ee1c65233f85bac84371a822f8c2d30b (diff) | |
download | servo-a58324f25b6f87d005026d8f9405c9f0d89a1f74.tar.gz servo-a58324f25b6f87d005026d8f9405c9f0d89a1f74.zip |
auto merge of #3522 : Ms2ger/servo/xhr-send-uaf, r=SimonSapin
The data is used later to set the Content-Type header. Current rustc
(4d2af3861) does not detect this use-after-move, but treats the later use as
if the data was None. It will, however, detect the bug in d2b30f7d3, which we
are upgrading to.
Diffstat (limited to 'components/script/dom/xmlhttprequest.rs')
-rw-r--r-- | components/script/dom/xmlhttprequest.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/components/script/dom/xmlhttprequest.rs b/components/script/dom/xmlhttprequest.rs index 4f310a8948b..49a8b861338 100644 --- a/components/script/dom/xmlhttprequest.rs +++ b/components/script/dom/xmlhttprequest.rs @@ -450,7 +450,7 @@ impl<'a> XMLHttpRequestMethods for JSRef<'a, XMLHttpRequest> { Get | Head => None, // Step 3 _ => data }; - let extracted = data.map(|d| d.extract()); + let extracted = data.as_ref().map(|d| d.extract()); self.request_body_len.set(extracted.as_ref().map(|e| e.len()).unwrap_or(0)); // Step 6 |