[git] GPGME - branch, bjk/master, updated. gpgme-1.5.1-13-gfff2049

by Ben Kibbey cvs at cvs.gnupg.org
Fri Oct 17 01:37:07 CEST 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "GnuPG Made Easy".

The branch, bjk/master has been updated
       via  fff2049c1bc7c627e11df8062ef1f96a7697954f (commit)
      from  aea2c168fc9c12148181dbcc33d7085aad8e6d90 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit fff2049c1bc7c627e11df8062ef1f96a7697954f
Author: Ben Kibbey <bjk at luxsci.net>
Date:   Thu Oct 16 19:26:41 2014 -0400

    Fix crash with built-in [v]asprintf().
    
    * src/vasprintf.c (__gpgme_vasprintf): Copy the va_list.
    --
    Not sure why it needs to be done. Maybe because of dereferencing the
    pointer while doing va_copy() int_vasprintf()? If we remove the
    _BSD_VA_LIST stuff and pass a regular va_list all is fine.

diff --git a/src/vasprintf.c b/src/vasprintf.c
index 326a2c3..18b1ef1 100644
--- a/src/vasprintf.c
+++ b/src/vasprintf.c
@@ -26,8 +26,6 @@ Boston, MA 02111-1307, USA.  */
 #include <stdlib.h>
 #include <stdarg.h>
 
-#include "mem.h"
-
 
 #ifndef va_copy /* According to POSIX, va_copy is a macro. */
 #if defined (__GNUC__) && defined (__PPC__) \
@@ -42,7 +40,14 @@ Boston, MA 02111-1307, USA.  */
 
 
 #ifdef TEST
+#define _gpgme_malloc  malloc
+#define _gpgme_calloc  calloc
+#define _gpgme_realloc realloc
+#define _gpgme_strdup  strdup
+#define _gpgme_free    free
 int global_total_width;
+#else
+#include "mem.h"
 #endif
 
 static int int_vasprintf (char **, const char *, va_list *);
@@ -161,7 +166,17 @@ _gpgme_vasprintf (result, format, args)
      va_list args;
 #endif
 {
-  return int_vasprintf (result, format, &args);
+#if defined (_BSD_VA_LIST_) && defined (__FreeBSD__)
+  _BSD_VA_LIST_ cp;
+#else
+  va_list cp;
+#endif
+  int ret;
+
+  va_copy(cp, args);
+  ret = int_vasprintf (result, format, &cp);
+  va_end(cp);
+  return ret;
 }
 
 

-----------------------------------------------------------------------

Summary of changes:
 src/vasprintf.c |   21 ++++++++++++++++++---
 1 file changed, 18 insertions(+), 3 deletions(-)


hooks/post-receive
-- 
GnuPG Made Easy
http://git.gnupg.org




More information about the Gnupg-commits mailing list