php.net |  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
Description:
------------
The following commit introduced the use of "va_list" to the bundled libgd:

https://github.com/php/php-src/commit/432e16cb58c76762d6b512f256f7e07d5c3857f4

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>
+#else
+# if HAVE_STDARG_H
+# include <stdarg.h>
+# else
+#  if HAVE_SYS_VARARGS_H
+#  include <sys/varargs.h>
+#  endif
+# endif
+#endif
+

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


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



Patches

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

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2017-06-11 14:58 UTC] cmb@php.net
-Status: Open +Status: Analyzed -Assigned To: +Assigned To: cmb
 [2017-06-11 14:58 UTC] cmb@php.net
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] cmb@php.net
Automatic comment on behalf of cmbecker69@gmx.de
Revision: http://git.php.net/?p=php-src.git;a=commit;h=68a0639c8f5afae87773e70cefcf706c6013e599
Log: Fix #74744: gd.h: stdarg.h include missing for va_list use in gdErrorMethod
 [2017-06-11 15:41 UTC] cmb@php.net
-Status: Analyzed +Status: Closed
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Tue Dec 03 17:01:29 2024 UTC