Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(138)

Unified Diff: mojo/public/rust/tests/util/mod.rs

Issue 2220183003: Rust: Add validation to decode (Closed) Base URL: git@github.com:domokit/mojo.git@coder-testing
Patch Set: Update from upstream branches (fixed arrays, validation code, etc.) Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « mojo/public/rust/tests/regression.rs ('k') | mojo/public/rust/tests/util/mojom_validation.rs » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/rust/tests/util/mod.rs
diff --git a/mojo/public/rust/tests/util/mod.rs b/mojo/public/rust/tests/util/mod.rs
index e36b8ac393f6f099e2c0632b896340ce362c96ec..b72b24c7da3215aa4deb7c480f1f04dab27bda36 100644
--- a/mojo/public/rust/tests/util/mod.rs
+++ b/mojo/public/rust/tests/util/mod.rs
@@ -68,7 +68,7 @@ pub fn parse_validation_test(input: &str) -> Result<(Vec<u8>, usize), String> {
&mut data_len as *mut usize)
};
if error == ptr::null_mut() {
- if data == ptr::null_mut() {
+ if data == ptr::null_mut() || data_len == 0 {
// We assume we were just given an empty file
Ok((Vec::new(), 0))
} else {
« no previous file with comments | « mojo/public/rust/tests/regression.rs ('k') | mojo/public/rust/tests/util/mojom_validation.rs » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698