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

Function insert_slice

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

Source from the content-addressed store, hash-verified

106}
107
108pub fn insert_slice(input: &mut Vec<u8>, x: &[u8], offset: usize) {
109 let position = offset..((offset + x.len()).min(input.len()));
110 input.resize(input.len() + x.len(), 0);
111 input.copy_within(position, offset + x.len());
112 input[offset..offset + x.len()].copy_from_slice(x);
113}
114
115pub fn insert_slice_strided(input: &mut Vec<u8>, x: &[u8], offset: usize, stride: usize) {
116 let len = x.len() * stride;

Callers 7

apply_mutationFunction · 0.85
insert_slice_emptyFunction · 0.85
insert_slice_middleFunction · 0.85
insert_slice_endFunction · 0.85
modify_inputFunction · 0.85
apply_extendedMethod · 0.85

Calls 1

lenMethod · 0.45

Tested by 3

insert_slice_emptyFunction · 0.68
insert_slice_middleFunction · 0.68
insert_slice_endFunction · 0.68