afl_custom_fuzz buffer explanation #2213
-
Hi all, it's unclear to me which are the options in using the 3 different buffers given to the From the documentation, little information is given on the meaning of "the returned buffer is under your memory management". Does it mean that if I allocate this, I should also be responsible for freeing it (I would assume so)? If so, can I assume that I will always get the same (pointer to the) buffer back on the next invocation of
Thanks in advance for the support 😄 The documentation I'm referring to: https://aflplus.plus/docs/custom_mutators/ The code:
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
I don't get the question here, buf is not mutated, it is copied to data->mutated_out and that buffer is mutated and also se as out_buf. |
Beta Was this translation helpful? Give feedback.
out_buf is what you allocate in your custom mutator and must free if you always create a new one. but you can just allocate it once (or a static buffer) and reuse it every time.
buf is the buffer that has the testcase to mutate.
add_buf containbs a second testcase (in case you want to splice parts of a random testcase in). usually you can ignore this one.