mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-27 06:43:32 +00:00
Bug 1906606 - Sanitize nsCString objects coming from crashed processes r=afranchuk
Also remove some logspam from the test harness. Differential Revision: https://phabricator.services.mozilla.com/D215899
This commit is contained in:
parent
8039bfea4c
commit
55422a7dec
@ -203,9 +203,15 @@ fn copy_nscstring(
|
||||
|
||||
if length > 0 {
|
||||
let data_address = reader.copy_object::<usize>(address)?;
|
||||
reader
|
||||
.copy_array::<u8>(data_address, length as _)
|
||||
.map(ThinVec::from)
|
||||
let mut vec = reader.copy_array::<u8>(data_address, length as _)?;
|
||||
|
||||
// Ensure that the string contains no nul characters.
|
||||
let nul_byte_pos = vec.iter().position(|&c| c == 0);
|
||||
if let Some(nul_byte_pos) = nul_byte_pos {
|
||||
vec.truncate(nul_byte_pos);
|
||||
}
|
||||
|
||||
Ok(ThinVec::from(vec))
|
||||
} else {
|
||||
Ok(ThinVec::<u8>::new())
|
||||
}
|
||||
|
@ -156,9 +156,6 @@ async function handleMinidump(callback) {
|
||||
registerCleanupFunction(cleanup);
|
||||
|
||||
Assert.ok(extrafile.exists());
|
||||
let data = await IOUtils.read(extrafile.path);
|
||||
let decoder = new TextDecoder("ascii");
|
||||
console.log("data = " + decoder.decode(data));
|
||||
let extra = await IOUtils.readJSON(extrafile.path);
|
||||
|
||||
if (callback) {
|
||||
|
Loading…
Reference in New Issue
Block a user