Commit ce33aec
committed
fix AflppCmpLogFnOperands::new to allow v0/v1 with different lengths
AflppCmpLogFnOperands has fixed length (`[u8; 32]`) storage for `v0` and
`v1`, and separate `v0_len`/`v1_len` fields. However, the rust
constructor/setters only allow for `v0`/`v1` to be initialized from
slices that are _exactly_ 32 bytes long, since `copy_from_slice` panics
otherwise. So `v0_len`/`v1_len` can only be 32. The instrumentation in
`libafl_targets`' `cmplog.{h,c}` can create log entries where the
`v0_len`/`v1_len` values are anywhere between 0 and 32, so this change
allows us to do the same from rust.
Note: in LibAFL's cmplog instrumentation, `v0_len`/`v1_len` are
always _the same_ value. In AFLplusplus' implementation,
`__cmplog_rtn_hook_str` can create log entries with `v0_len !=
v1_len`.1 parent e75d518 commit ce33aec
1 file changed
Lines changed: 16 additions & 14 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
224 | 224 | | |
225 | 225 | | |
226 | 226 | | |
227 | | - | |
228 | | - | |
| 227 | + | |
| 228 | + | |
229 | 229 | | |
230 | 230 | | |
231 | 231 | | |
| |||
235 | 235 | | |
236 | 236 | | |
237 | 237 | | |
238 | | - | |
239 | | - | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
240 | 242 | | |
241 | | - | |
242 | | - | |
| 243 | + | |
| 244 | + | |
243 | 245 | | |
244 | | - | |
245 | | - | |
| 246 | + | |
| 247 | + | |
246 | 248 | | |
247 | 249 | | |
248 | 250 | | |
| |||
255 | 257 | | |
256 | 258 | | |
257 | 259 | | |
258 | | - | |
| 260 | + | |
259 | 261 | | |
260 | 262 | | |
261 | 263 | | |
| |||
267 | 269 | | |
268 | 270 | | |
269 | 271 | | |
270 | | - | |
| 272 | + | |
271 | 273 | | |
272 | 274 | | |
273 | 275 | | |
| |||
279 | 281 | | |
280 | 282 | | |
281 | 283 | | |
282 | | - | |
283 | | - | |
| 284 | + | |
| 285 | + | |
284 | 286 | | |
285 | 287 | | |
286 | 288 | | |
287 | 289 | | |
288 | | - | |
289 | | - | |
| 290 | + | |
| 291 | + | |
290 | 292 | | |
291 | 293 | | |
292 | 294 | | |
| |||
0 commit comments