summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Sandall2008-04-26 17:00:19 -0700
committerEric Sandall2008-04-27 13:19:47 -0700
commit21a5ff7904e95da6c9dc4d757971ee961598587d (patch)
tree6df0b55e40b18436bf94678f6383acdd5add9346
parent6ba319df93159db019e65eb6a4c5796cfa6c37f8 (diff)
pinentry: Upstream patch to fix Bug #14471 from https://bugs.g10code.com/gnupg/issue893
(cherry picked from commit 16638de474e0e7d4d73b623a773879025127f71c)
-rw-r--r--crypto/pinentry/HISTORY5
-rwxr-xr-xcrypto/pinentry/PRE_BUILD3
-rw-r--r--crypto/pinentry/g_mem_set_vtable.diff99
3 files changed, 107 insertions, 0 deletions
diff --git a/crypto/pinentry/HISTORY b/crypto/pinentry/HISTORY
index c22bf28383..6d1e295605 100644
--- a/crypto/pinentry/HISTORY
+++ b/crypto/pinentry/HISTORY
@@ -1,3 +1,8 @@
+2008-04-26 Eric Sandall <sandalle@sourcemage.org>
+ * PRE_BUILD: Apply g_mem_set_vtable.diff
+ * g_mem_set_vtable.diff: Upstream patch to fix Bug #14471
+ from https://bugs.g10code.com/gnupg/issue893
+
2008-02-16 Ladislav Hagara <hgr@vabo.cz>
* DETAILS: 0.7.5
diff --git a/crypto/pinentry/PRE_BUILD b/crypto/pinentry/PRE_BUILD
new file mode 100755
index 0000000000..dbf098ff3b
--- /dev/null
+++ b/crypto/pinentry/PRE_BUILD
@@ -0,0 +1,3 @@
+default_pre_build &&
+cd $SOURCE_DIRECTORY &&
+patch -p1 < $SCRIPT_DIRECTORY/g_mem_set_vtable.diff
diff --git a/crypto/pinentry/g_mem_set_vtable.diff b/crypto/pinentry/g_mem_set_vtable.diff
new file mode 100644
index 0000000000..715328a64b
--- /dev/null
+++ b/crypto/pinentry/g_mem_set_vtable.diff
@@ -0,0 +1,99 @@
+only in patch2:
+unchanged:
+--- pinentry-0.7.5.orig/gtk+-2/gtksecentry.h
++++ pinentry-0.7.5/gtk+-2/gtksecentry.h
+@@ -173,6 +173,11 @@
+ gtk_secure_entry_get_layout_offsets(GtkSecureEntry * entry,
+ gint * x, gint * y);
+
++gpointer secentry_malloc(gsize size);
++gpointer secentry_malloc0(gsize size);
++gpointer secentry_realloc(gpointer mem, gsize size);
++void secentry_free(gpointer mem);
++
+ #ifdef __cplusplus
+ }
+ #endif /* __cplusplus */
+only in patch2:
+unchanged:
+--- pinentry-0.7.5.orig/gtk+-2/gtksecentry.c
++++ pinentry-0.7.5/gtk+-2/gtksecentry.c
+@@ -270,7 +270,7 @@
+
+
+ gpointer
+-g_malloc(gulong size)
++secentry_malloc(gsize size)
+ {
+ gpointer p;
+
+@@ -282,13 +282,13 @@
+ else
+ p = (gpointer) malloc(size);
+ if (!p)
+- g_error("could not allocate %ld bytes", size);
++ g_error("could not allocate %" G_GSIZE_FORMAT " bytes", size);
+
+ return p;
+ }
+
+ gpointer
+-g_malloc0(gulong size)
++secentry_malloc0(gsize size)
+ {
+ gpointer p;
+
+@@ -302,13 +302,13 @@
+ } else
+ p = (gpointer) calloc(size, 1);
+ if (!p)
+- g_error("could not allocate %ld bytes", size);
++ g_error("could not allocate %" G_GSIZE_FORMAT " bytes", size);
+
+ return p;
+ }
+
+ gpointer
+-g_realloc(gpointer mem, gulong size)
++secentry_realloc(gpointer mem, gsize size)
+ {
+ gpointer p;
+
+@@ -332,13 +332,13 @@
+ }
+
+ if (!p)
+- g_error("could not reallocate %lu bytes", (gulong) size);
++ g_error("could not allocate %" G_GSIZE_FORMAT " bytes", size);
+
+ return p;
+ }
+
+ void
+-g_free(gpointer mem)
++secentry_free(gpointer mem)
+ {
+ if (mem) {
+ if (m_is_secure(mem))
+only in patch2:
+unchanged:
+--- pinentry-0.7.5.orig/gtk+-2/pinentry-gtk-2.c
++++ pinentry-0.7.5/gtk+-2/pinentry-gtk-2.c
+@@ -473,6 +473,17 @@
+ int
+ main (int argc, char *argv[])
+ {
++ static GMemVTable secure = {
++ secentry_malloc,
++ secentry_realloc,
++ secentry_free,
++ NULL,
++ NULL,
++ NULL
++ };
++
++ g_mem_set_vtable (&secure);
++
+ pinentry_init (PGMNAME);
+
+ #ifdef FALLBACK_CURSES