summaryrefslogtreecommitdiff
path: root/keystore2/src/fuzzers
diff options
context:
space:
mode:
authorChris Wailes <chriswailes@google.com>2023-03-06 12:25:35 -0800
committerChris Wailes <chriswailes@google.com>2023-03-08 10:21:06 -0800
commitbac435591f2cc9025d11a0cdbcee5f963bf67a57 (patch)
tree1e91eeb94c00a10bee4caf576b429421af59629e /keystore2/src/fuzzers
parent71e6c96283267f907e2df0d3dee78c28cb1c76ab (diff)
downloadsecurity-bac435591f2cc9025d11a0cdbcee5f963bf67a57.tar.gz
Remove usage of slice_internals feature
This CL replaces the usage of the core::slice::memchr function with calls to std::iter::position. Test: m keystore2_unsafe_fuzzer Test: TH Bug: 267698452 Change-Id: I33cab09176d0ff02ce092e240e887ece98728915
Diffstat (limited to 'keystore2/src/fuzzers')
-rw-r--r--keystore2/src/fuzzers/keystore2_unsafe_fuzzer.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/keystore2/src/fuzzers/keystore2_unsafe_fuzzer.rs b/keystore2/src/fuzzers/keystore2_unsafe_fuzzer.rs
index 32911908..0dca3a24 100644
--- a/keystore2/src/fuzzers/keystore2_unsafe_fuzzer.rs
+++ b/keystore2/src/fuzzers/keystore2_unsafe_fuzzer.rs
@@ -14,11 +14,9 @@
//! Fuzzes unsafe APIs of libkeystore2 module
-#![feature(slice_internals)]
#![no_main]
use binder::get_declared_instances;
-use core::slice::memchr;
use keystore2::{legacy_blob::LegacyBlobLoader, utils::ui_opts_2_compat};
use keystore2_aaid::get_aaid;
use keystore2_apc_compat::ApcHal;
@@ -38,7 +36,7 @@ const MAX_SIZE_MODIFIER: usize = 1024;
/// CString does not contain any internal 0 bytes
fn get_valid_cstring_data(data: &[u8]) -> &[u8] {
- match memchr::memchr(0, data) {
+ match data.iter().position(|&b| b == 0) {
Some(idx) => &data[0..idx],
None => data,
}