post_process 0/NULL return support

This commit is contained in:
vanhauser-thc
2022-07-19 12:24:03 +02:00
parent b847e0f414
commit ca4a8c0f92
7 changed files with 82 additions and 15 deletions

View File

@ -535,7 +535,16 @@ size_t post_process_py(void *py_mutator, u8 *buf, size_t buf_size,
Py_DECREF(py_value);
*out_buf = (u8 *)py->post_process_buf.buf;
if (unlikely(py->post_process_buf.len == 0)) {
*out_buf = NULL;
} else {
*out_buf = (u8 *)py->post_process_buf.buf;
}
return py->post_process_buf.len;
} else {