|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #74744 gd.h: stdarg.h include missing for va_list use in gdErrorMethod
Submitted: 2017-06-11 11:37 UTC Modified: 2017-06-11 14:58 UTC
From: rainer dot jung at kippdata dot de Assigned: cmb (profile)
Status: Closed Package: GD related
PHP Version: 7.2.0alpha1 OS: Solaris
Private report: No CVE-ID: None
 [2017-06-11 11:37 UTC] rainer dot jung at kippdata dot de
The following commit introduced the use of "va_list" to the bundled libgd:

va_list either needs an include for stdarg.h or varargs.h. Upstream libgd include stdarg.h unconditionally. If we want to stick with what php.h does, the following patch would be appropriate:

--- ext/gd/libgd/gd.h 2017-06-06 15:25:00.000000000 +0200
+++ ext/gd/libgd/gd.h   2017-06-11 13:31:24.826517000 +0200
@@ -46,5 +46,18 @@
 #include <stdio.h>
 #include "gd_io.h"

+/* va_list needed in gdErrorMethod */
+#ifdef PHP_WIN32
+# include <stdarg.h>
+# include <stdarg.h>
+# else
+#  include <sys/varargs.h>
+#  endif
+# endif

 /* The maximum number of palette entries in palette-based images.

The problem exists in 7.2 and master, not in 7.1.


libgd-stdarg.patch (last revision 2017-06-11 11:38 UTC by rainer dot jung at kippdata dot de)

Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-11 14:58 UTC]
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: cmb
 [2017-06-11 14:58 UTC]
Thanks, Rainer! Guess it makes sense to stick with PHP's
conditional inclusion for now, so I'm going to apply your patch.
 [2017-06-11 15:41 UTC]
Automatic comment on behalf of
Log: Fix #74744: gd.h: stdarg.h include missing for va_list use in gdErrorMethod
 [2017-06-11 15:41 UTC]
-Status: Analyzed +Status: Closed
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Jun 19 10:01:29 2024 UTC