MCPcopy Create free account
hub / github.com/MultiFuzz/MultiFuzz / insert_slice_strided

Function insert_slice_strided

hail-fuzz/src/utils.rs:115–125  ·  view source on GitHub ↗
(input: &mut Vec<u8>, x: &[u8], offset: usize, stride: usize)

Source from the content-addressed store, hash-verified

113}
114
115pub fn insert_slice_strided(input: &mut Vec<u8>, x: &[u8], offset: usize, stride: usize) {
116 let len = x.len() * stride;
117
118 let position = offset..((offset + len).min(input.len()));
119 input.resize(input.len() + len, 0);
120 input.copy_within(position, offset + len);
121
122 for (chunk, byte) in input[offset..offset + len].chunks_exact_mut(stride).zip(x) {
123 chunk.fill(*byte);
124 }
125}
126
127pub fn replace_slice_strided(input: &mut Vec<u8>, x: &[u8], offset: usize, stride: usize) {
128 let len = x.len() * stride;

Callers 4

apply_mutationFunction · 0.85
insert_strided_emptyFunction · 0.85
insert_strided_middleFunction · 0.85
insert_strided_endFunction · 0.85

Calls 1

lenMethod · 0.45

Tested by 3

insert_strided_emptyFunction · 0.68
insert_strided_middleFunction · 0.68
insert_strided_endFunction · 0.68