Skip to content

Commit

Permalink
Make --replay-fuzz friendlier to work with in debugger.
Browse files Browse the repository at this point in the history
We make effectively input zero-terminated so debugger doesn't attempt to
write more than what's really provided.
  • Loading branch information
mity committed Jan 17, 2024
1 parent f45dd44 commit 2ba5e2c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions md2html/md2html.c
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,10 @@ process_file(const char* in_path, FILE* in, FILE* out)
memmove(buf_in.data, buf_in.data + 2 * sizeof(unsigned),
buf_in.size - 2 * sizeof(unsigned));
buf_in.size -= 2 * sizeof(unsigned);

/* Zero the tail we have moved the contents from.
* It helps in debugging if make it actually a zero-terminated string. */
memset(buf_in.data + buf_in.size, 0, 2 * sizeof(unsigned));
}

/* Parse the document. This shall call our callbacks provided via the
Expand Down

0 comments on commit 2ba5e2c

Please sign in to comment.