bug in newpg-0.9.4/common vasprintf implementation

Andrew J. Schorr aschorr at telemetry-investments.com
Tue Nov 11 10:43:19 CET 2003


I just built newpg-0.9.4 on Solaris 8/x86 which does not have the
apsprintf() and vasprintf() functions in the C library.  As a result,
the build uses the implementation located in common/vasprintf.c.
However, there is a minor bug in that implementation (for some reason,
the 3rd argument to vasprintf was declared as a pointer to a va_list
instead of a va_list).  Anyway, I am attaching the trivial patch to get
things working on Solaris.  Gpg-agent no longer SEGV's after this patch
has been applied.

I hope this mailing list is the proper place to submit such patches.
I apologize in advance if it's not.

-------------- next part --------------
--- common/util.h.0	Fri Aug  9 09:47:51 2002
+++ common/util.h	Tue Nov 11 09:57:19 2003
@@ -71,7 +71,7 @@
 /*-- replacement functions from funcname.c --*/
 #include <stdarg.h>
-int vasprintf (char **result, const char *format, va_list *args);
+int vasprintf (char **result, const char *format, va_list args);
 int asprintf (char **result, const char *format, ...);
--- common/vasprintf.c.0	Mon Sep  9 06:10:40 2002
+++ common/vasprintf.c	Tue Nov 11 09:56:48 2003
@@ -31,7 +31,7 @@
-vasprintf (char **result, const char *format, va_list *args)
+vasprintf (char **result, const char *format, va_list args)
   const char *p = format;
   /* Add one to make sure that it is never zero, which might cause malloc
@@ -120,7 +120,7 @@
   *result = malloc (total_width);
   if (*result != NULL)
-    return vsprintf (*result, format, *args);
+    return vsprintf (*result, format, args);
     return 0;

More information about the Gnupg-devel mailing list