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

Method next_bytes

hail-fuzz/src/input.rs:111–121  ·  view source on GitHub ↗
(&mut self, addr: StreamKey, size: usize)

Source from the content-addressed store, hash-verified

109 }
110
111 pub fn next_bytes(&mut self, addr: StreamKey, size: usize) -> Option<&[u8]> {
112 self.last_read = Some(addr);
113 let stream = self.streams.get_mut(&addr)?;
114 let buf = stream.bytes.get(stream.cursor as usize..stream.cursor as usize + size)?;
115 if let Some(tracer) = self.tracer.as_mut() {
116 tracer.read(addr, buf);
117 }
118 stream.sizes |= size as u32;
119 stream.cursor += size as u32;
120 Some(buf)
121 }
122
123 pub fn clear(&mut self) {
124 self.streams.values_mut().for_each(|x| x.clear());

Callers 1

readMethod · 0.45

Calls 3

get_mutMethod · 0.80
getMethod · 0.45
readMethod · 0.45

Tested by

no test coverage detected