[PATCH] missing va_end() in some IO functions (gmp 6.1.2)

Vincent Lefevre vincent at vinc17.net
Wed Mar 13 12:58:13 UTC 2019

On 2019-03-13 13:48:17 +0100, Torbjorn Granlund wrote:
> Jakub Martisko <jamartis at redhat.com> writes:
>   I believe there are some missing va_end() calls in some of the IO
>   functions of GMP 6.1.2. See attached patch for details.
> Are you sure that's how stdarg works?
> I see no problems with GMP's current code.  I believe your patch is
> incorrect in several ways.

I won't comment on the patch here, but GMP's current code appears
to be incorrect. For instance, printf/doprnt.c uses va_copy several
times, but I can see no matching va_end.

As described in the va_copy(3) man page:

    Each invocation of va_copy() must be matched by a corresponding
    invocation of va_end() in the same function.

Vincent Lefèvre <vincent at vinc17.net> - Web: <https://www.vinc17.net/>
100% accessible validated (X)HTML - Blog: <https://www.vinc17.net/blog/>
Work: CR INRIA - computer arithmetic / AriC project (LIP, ENS-Lyon)

More information about the gmp-bugs mailing list