This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH] Demangler fuzzer
- From: Jakub Jelinek <jakub at redhat dot com>
- To: Gary Benson <gbenson at redhat dot com>
- Cc: gcc-patches at gcc dot gnu dot org
- Date: Mon, 11 Aug 2014 11:39:45 +0200
- Subject: Re: [PATCH] Demangler fuzzer
- Authentication-results: sourceware.org; auth=none
- References: <20140811092703 dot GA3193 at blade dot nx>
- Reply-to: Jakub Jelinek <jakub at redhat dot com>
On Mon, Aug 11, 2014 at 10:27:03AM +0100, Gary Benson wrote:
> This patch adds a simple fuzzer for the libiberty C++ demangler.
> You can run it like this:
>
> make -C /path/to/build/libiberty/testsuite fuzz-demangler
>
> It will run until it dumps core (usually only a few seconds).
>
> Is this ok to commit?
I think it is bad when the command never succeeds in case of success.
There should be some limit on the number of iterations (perhaps a parameter
to the program), or timeout.
> + for (i = 0; i < length; i++)
> + *(buffer++) = (rand () % (ALPMAX - ALPMIN)) + ALPMIN;
> +
> + *(buffer++) = '\0';
Please use just *buffer++ instead of *(buffer++) in both places.
Jakub