[Python-Dev] [Python-checkins] cpython: Issue #17828: va_start() must be accompanied by va_end()
Nick Coghlan
ncoghlan at gmail.com
Thu Nov 14 01:50:18 CET 2013
On 14 Nov 2013 10:40, "christian.heimes" <python-checkins at python.org> wrote:
>
> http://hg.python.org/cpython/rev/99ba1772c469
> changeset: 87089:99ba1772c469
> user: Christian Heimes <christian at cheimes.de>
> date: Thu Nov 14 01:39:35 2013 +0100
> summary:
> Issue #17828: va_start() must be accompanied by va_end()
> CID 1128793: Missing varargs init or cleanup (VARARGS)
Today I learned... :)
Thanks!
Cheers,
Nick.
>
> files:
> Objects/exceptions.c | 13 +++++++------
> 1 files changed, 7 insertions(+), 6 deletions(-)
>
>
> diff --git a/Objects/exceptions.c b/Objects/exceptions.c
> --- a/Objects/exceptions.c
> +++ b/Objects/exceptions.c
> @@ -2632,12 +2632,6 @@
> PyObject *new_exc, *new_val, *new_tb;
> va_list vargs;
>
> -#ifdef HAVE_STDARG_PROTOTYPES
> - va_start(vargs, format);
> -#else
> - va_start(vargs);
> -#endif
> -
> PyErr_Fetch(&exc, &val, &tb);
> caught_type = (PyTypeObject *) exc;
> /* Ensure type info indicates no extra state is stored at the C
level */
> @@ -2690,7 +2684,14 @@
> * types as well, but that's quite a bit trickier due to the extra
> * state potentially stored on OSError instances.
> */
> +
> +#ifdef HAVE_STDARG_PROTOTYPES
> + va_start(vargs, format);
> +#else
> + va_start(vargs);
> +#endif
> msg_prefix = PyUnicode_FromFormatV(format, vargs);
> + va_end(vargs);
> if (msg_prefix == NULL)
> return NULL;
>
>
> --
> Repository URL: http://hg.python.org/cpython
>
> _______________________________________________
> Python-checkins mailing list
> Python-checkins at python.org
> https://mail.python.org/mailman/listinfo/python-checkins
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20131114/69dfc878/attachment.html>
More information about the Python-Dev
mailing list