about summary refs log tree commit diff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/afl-fuzz.h4
-rw-r--r--include/list.h4
2 files changed, 5 insertions, 3 deletions
diff --git a/include/afl-fuzz.h b/include/afl-fuzz.h
index 357cd854..a9165064 100644
--- a/include/afl-fuzz.h
+++ b/include/afl-fuzz.h
@@ -713,8 +713,8 @@ struct custom_mutator {
    *
    * @param data pointer returned in afl_custom_init for this fuzz case
    * @param[out] out_buf Pointer to the buffer containing the trimmed test case.
-   *     External library should allocate memory for out_buf. AFL++ will release
-   *     the memory after saving the test case.
+   *             The library can reuse a buffer for each call
+   *             and will have to free the buf (for example in deinit)
    * @return the size of the trimmed test case
    */
   size_t (*afl_custom_trim)(void *data, u8 **out_buf);
diff --git a/include/list.h b/include/list.h
index c67b24b2..d9cd9d34 100644
--- a/include/list.h
+++ b/include/list.h
@@ -56,7 +56,8 @@ typedef struct list {
 
 static inline element_t *get_head(list_t *list) {
 
-  return &list->element_prealloc_buf[0];
+  /* The first element is the head */
+  return list->element_prealloc_buf;
 
 }
 
@@ -106,6 +107,7 @@ static inline void list_append(list_t *list, void *el) {
     if (!el_box) FATAL("foreach over uninitialized list"); \
     while (el_box != head) {                               \
                                                            \
+      __attribute__((unused))                              \
       type *el = (type *)((el_box)->data);                 \
       /* get next so el_box can be unlinked */             \
       element_t *next = el_box->next;                      \