Bug #62769 unportable usage of va_list in sql-common/client_plugin.c
Submitted: 17 Oct 2011 3:27 Modified: 5 Jun 2013 17:24
Reporter: [ name withheld ] Email Updates:
Status: Closed Impact on me:
None 
Category:MySQL Server: Compiling Severity:S3 (Non-critical)
Version:5.5.16 OS:Any
Assigned to: CPU Architecture:Any
Tags: Contribution

[17 Oct 2011 3:27] [ name withheld ]
Description:
There are two places in sql-common/client_plugin.c that pass "0" to a function that is declared to take a va_list parameter.  This only works if va_list is of an integer or pointer type, which is not required by the C standard, and is not the case on some less-common architectures such as ARM.

This was previously reported to the Maria folk:
https://bugs.launchpad.net/maria/+bug/700982
and also here:
https://bugzilla.redhat.com/show_bug.cgi?id=744707

How to repeat:
Try to compile on Fedora ARM, or another architecture where va_list is a struct or array.

Suggested fix:
I attach a proposed patch, which is similar to what the Maria folk applied, but avoids "uninitialized variable" warnings.
[17 Oct 2011 3:28] [ name withheld ]
Proposed patch

Attachment: mysql-va-list.patch (application/octet-stream, text), 1.56 KiB.

[17 Oct 2011 3:57] Valeriy Kravchuk
Thank you for the problem report and patch contributed.
[24 May 2013 23:39] Michel Kunkler
Why has this patch not been applied to the newest mysql version yet?
[5 Jun 2013 17:24] Paul DuBois
Noted in 5.6.13, 5.7.2 changelogs.

sql-common/client_plugin.c contained a nonportable use of a va_list
parameter.
[23 Sep 2013 9:21] MySQL Verification Team
Bug #70347 marked as duplicate of this one.