code:
This patch was copied from Debian.

Description: Fix tests/futility/test_show_contents.sh
 Tests compare generated files containing the file path and upstream files
 ("expected output") containing path like
 "/mnt/host/source/src/platform/vboot_reference/tests/".  They can't
 match. Drop these lines mentioning paths in the generated files and in
 the upstream provided files to avoid failures.
Author: Sophie Brun <sophie@freexian.com>
Last-Update: 2017-11-14
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/futility/expect_output/show.tests_devkeys_kernel.keyblock
+++ b/tests/futility/expect_output/show.tests_devkeys_kernel.keyblock
@@ -1,4 +1,3 @@
-Key block:               /mnt/host/source/src/platform/vboot_reference/tests/devkeys/kernel.keyblock
   Signature:             ignored
   Size:                  0x4b8
   Flags:                 7  !DEV DEV !REC
--- a/tests/futility/expect_output/show.tests_devkeys_root_key.vbprivk
+++ b/tests/futility/expect_output/show.tests_devkeys_root_key.vbprivk
@@ -1,4 +1,3 @@
-Private Key file:      /mnt/host/source/src/platform/vboot_reference/tests/devkeys/root_key.vbprivk
   Vboot API:           1.0
   Algorithm:           11 RSA8192 SHA512
   Key sha1sum:         b11d74edd286c144e1135b49e7f0bc20cf041f10
--- a/tests/futility/expect_output/show.tests_devkeys_root_key.vbpubk
+++ b/tests/futility/expect_output/show.tests_devkeys_root_key.vbpubk
@@ -1,4 +1,3 @@
-Public Key file:       /mnt/host/source/src/platform/vboot_reference/tests/devkeys/root_key.vbpubk
   Vboot API:           1.0
   Algorithm:           11 RSA8192 SHA512
   Key Version:         1
--- a/tests/futility/expect_output/show.tests_futility_data_bios_mario_mp.bin
+++ b/tests/futility/expect_output/show.tests_futility_data_bios_mario_mp.bin
@@ -1,4 +1,3 @@
-BIOS:                    /mnt/host/source/src/platform/vboot_reference/tests/futility/data/bios_mario_mp.bin
 GBB header:              GBB Area
   Version:               1.0
   Flags:                 0x00000000
--- a/tests/futility/expect_output/show.tests_futility_data_bios_zgb_mp.bin
+++ b/tests/futility/expect_output/show.tests_futility_data_bios_zgb_mp.bin
@@ -1,4 +1,3 @@
-BIOS:                    /mnt/host/source/src/platform/vboot_reference/tests/futility/data/bios_zgb_mp.bin
 GBB header:              GBB
   Version:               1.0
   Flags:                 0x00000000
--- a/tests/futility/expect_output/show.tests_futility_data_fw_gbb.bin
+++ b/tests/futility/expect_output/show.tests_futility_data_fw_gbb.bin
@@ -1,4 +1,3 @@
-GBB header:              /mnt/host/source/src/platform/vboot_reference/tests/futility/data/fw_gbb.bin
   Version:               1.1
   Flags:                 0x00000039
   Regions:                 offset       size
--- a/tests/futility/expect_output/show.tests_futility_data_fw_vblock.bin
+++ b/tests/futility/expect_output/show.tests_futility_data_fw_vblock.bin
@@ -1,4 +1,3 @@
-Key block:               /mnt/host/source/src/platform/vboot_reference/tests/futility/data/fw_vblock.bin
   Signature:             ignored
   Size:                  0x8b8
   Flags:                 7  !DEV DEV !REC
--- a/tests/futility/expect_output/show.tests_futility_data_kern_preamble.bin
+++ b/tests/futility/expect_output/show.tests_futility_data_kern_preamble.bin
@@ -1,4 +1,3 @@
-Kernel partition:        /mnt/host/source/src/platform/vboot_reference/tests/futility/data/kern_preamble.bin
 Key block:
   Signature:             ignored
   Size:                  0x5b8
--- a/tests/futility/expect_output/show.tests_futility_data_sample.vbprik2
+++ b/tests/futility/expect_output/show.tests_futility_data_sample.vbprik2
@@ -1,4 +1,3 @@
-Private key file:      /mnt/host/source/src/platform/vboot_reference/tests/futility/data/sample.vbprik2
   Vboot API:           2.1
   Desc:                "sample vb21 keypair"
   Signature Algorithm: 5 RSA8192
--- a/tests/futility/expect_output/show.tests_futility_data_sample.vbpubk2
+++ b/tests/futility/expect_output/show.tests_futility_data_sample.vbpubk2
@@ -1,4 +1,3 @@
-Public Key file:       /mnt/host/source/src/platform/vboot_reference/tests/futility/data/sample.vbpubk2
   Vboot API:           2.1
   Desc:                "sample vb21 keypair"
   Signature Algorithm: 5 RSA8192
--- a/tests/futility/expect_output/show.tests_testkeys_key_rsa2048.pem
+++ b/tests/futility/expect_output/show.tests_testkeys_key_rsa2048.pem
@@ -1,3 +1,2 @@
-Private Key file:      /mnt/host/source/src/platform/vboot_reference/tests/testkeys/key_rsa2048.pem
   Key length:          2048
   Key sha1sum:         bfb2fa9188a87bf766dd7c313ea6802553b646b6
--- a/tests/futility/expect_output/show.tests_testkeys_key_rsa8192.pub.pem
+++ b/tests/futility/expect_output/show.tests_testkeys_key_rsa8192.pub.pem
@@ -1,3 +1,2 @@
-Public Key file:      /mnt/host/source/src/platform/vboot_reference/tests/testkeys/key_rsa8192.pub.pem
   Key length:          8192
   Key sha1sum:         f1afa44a1aed0d0e9ff630579df920a725e9de5e
--- a/tests/futility/test_show_contents.sh
+++ b/tests/futility/test_show_contents.sh
@@ -29,7 +29,7 @@ for file in $SHOW_FILES; do
     outfile="show.${file//\//_}"
     gotfile="${OUTDIR}/${outfile}"
     wantfile="${SRCDIR}/tests/futility/expect_output/${outfile}"
-    ${FUTILITY} show "${SRCDIR}/${file}" | tee "${gotfile}"
+    ${FUTILITY} show "${SRCDIR}/${file}" | grep -v "tests/" | tee "${gotfile}"

     # Uncomment this to update the expected output
     #cp ${gotfile} ${wantfile}
@@ -48,7 +48,7 @@ for file in $VBUTIL_KEY_FILES; do
     outfile="vbutil_key.${file//\//_}"
     gotfile="${OUTDIR}/${outfile}"
     wantfile="${SRCDIR}/tests/futility/expect_output/${outfile}"
-    ${FUTILITY} vbutil_key --unpack "${SRCDIR}/${file}" | tee "${gotfile}"
+    ${FUTILITY} vbutil_key --unpack "${SRCDIR}/${file}" | grep -v "tests/" | tee "${gotfile}"

     # Uncomment this to update the expected output
     #cp ${gotfile} ${wantfile}
@@ -64,7 +64,7 @@ gotfile="${OUTDIR}/${outfile}"
 wantfile="${SRCDIR}/tests/futility/expect_output/${outfile}"
 ${FUTILITY} vbutil_keyblock --unpack "${SRCDIR}/${file}" \
     --signpubkey "${SRCDIR}/tests/devkeys/kernel_subkey.vbpubk" \
-    | tee "${gotfile}"
+    | grep -v "tests/" | tee "${gotfile}"

 # Uncomment this to update the expected output
 #cp ${gotfile} ${wantfile}
--- a/tests/futility/expect_output/vbutil_key.tests_devkeys_root_key.vbprivk
+++ b/tests/futility/expect_output/vbutil_key.tests_devkeys_root_key.vbprivk
@@ -1,2 +1 @@
-Private Key file:  /mnt/host/source/src/platform/vboot_reference/tests/devkeys/root_key.vbprivk
 Algorithm:         11 RSA8192 SHA512
--- a/tests/futility/expect_output/vbutil_keyblock.tests_devkeys_kernel.keyblock
+++ b/tests/futility/expect_output/vbutil_keyblock.tests_devkeys_kernel.keyblock
@@ -1,4 +1,3 @@
-Key block file:       /mnt/host/source/src/platform/vboot_reference/tests/devkeys/kernel.keyblock
 Signature             valid
 Flags:                7  !DEV DEV !REC
 Data key algorithm:   4 RSA2048 SHA256
--- a/tests/futility/expect_output/vbutil_key.tests_devkeys_root_key.vbpubk
+++ b/tests/futility/expect_output/vbutil_key.tests_devkeys_root_key.vbpubk
@@ -1,4 +1,3 @@
-Public Key file:   /mnt/host/source/src/platform/vboot_reference/tests/devkeys/root_key.vbpubk
 Algorithm:         11 RSA8192 SHA512
 Key Version:       1
 Key sha1sum:       b11d74edd286c144e1135b49e7f0bc20cf041f10


code:
This patch was copied from Debian.

Description: skip the workbuf test if VB2_WORKBUF_ALIGN different from 16
Author: Sophie Brun <sophie@freexian.com>
Last-Update: 2015-12-03
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/tests/vb2_common_tests.c
+++ b/tests/vb2_common_tests.c
@@ -70,6 +70,11 @@ static void test_workbuf(void)
 	/* NOTE: There are several magic numbers below which assume that
 	 * VB2_WORKBUF_ALIGN == 16 */

+        /* Skip the tests if VB2_WORKBUF_ALIGN != 16 */
+        if (VB2_WORKBUF_ALIGN != 16) {
+            return;
+        }
+
 	/* Init */
 	vb2_workbuf_init(&wb, p0, 64);
 	TEST_EQ(vb2_offset_of(p0, wb.buf), 0, "Workbuf init aligned");

repo_name: maximed/guix

license: mit


code:
Fix build with Boost + Python 3.7.

Taken from upstream:
https://github.com/ukoethe/vigra/commit/a6fa62663c6a6b752ed0707e95f643e25867a0f9

diff --git a/vigranumpy/src/core/vigranumpycore.cxx b/vigranumpy/src/core/vigranumpycore.cxx
index ec38d3636..c81c6ae52 100644
--- a/vigranumpy/src/core/vigranumpycore.cxx
+++ b/vigranumpy/src/core/vigranumpycore.cxx
@@ -61,7 +61,7 @@ UInt32 pychecksum(python::str const & s)
 	return checksum(data, size);
 #else
 	Py_ssize_t size = 0;
-	char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
+	const char * data = PyUnicode_AsUTF8AndSize(s.ptr(), &size);
 	return checksum(data, size);
 #endif
 }


code:
https://gitlab.gnome.org/GNOME/vinagre/merge_requests/4.patch

From 83ec3835c36d5cd2c957512c18d21a33b4136c95 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Tue, 20 Nov 2018 14:57:17 +0100
Subject: [PATCH 1/2] Fix build with recent FreeRDP versions

Vinagre is not buildable with recent FreeRDP versions and similar patches
are used by distributions to fix that. I have also removed some old
compatibility codes, because it wasn't buildable against 1.0, nor 1.1
anyway and 1.2 has never been officially released and is superseded by 2.0.

https://gitlab.gnome.org/GNOME/vinagre/issues/4
---
 configure.ac                  |   7 +-
 plugins/rdp/vinagre-rdp-tab.c | 129 +++++++---------------------------
 2 files changed, 27 insertions(+), 109 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5b51a82..61617f1 100644
--- a/configure.ac
+++ b/configure.ac
@@ -58,16 +58,15 @@ AS_IF([test "x$have_ssh" = "xyes"],
 AM_CONDITIONAL([VINAGRE_ENABLE_SSH], [test "x$have_ssh" = "xyes"])

 # Whether to enable support for RDP.
-RDP_DEPS="freerdp x11"
+RDP_DEPS="freerdp2 x11"
+
 AC_ARG_ENABLE([rdp],
   [AS_HELP_STRING([--disable-rdp],
     [Disable Remote Desktop Protocol (RDP) support])])

 AS_IF([test "x$enable_rdp" != "xno"],
   [PKG_CHECK_EXISTS([$RDP_DEPS],
-    [have_rdp=yes
-     PKG_CHECK_EXISTS(freerdp >= 1.1,
-       [AC_DEFINE([HAVE_FREERDP_1_1], [1], [FreeRDP is of version 1.1 or newer])], [])],
+    [have_rdp=yes],
     [have_rdp=no])],
   [have_rdp=no])

diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index 5b98c24..28e3eb6 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -29,12 +29,7 @@
 #include <freerdp/types.h>
 #include <freerdp/freerdp.h>
 #include <freerdp/gdi/gdi.h>
-#if HAVE_FREERDP_1_1
 #include <freerdp/locale/keyboard.h>
-#else
-#include <freerdp/kbd/vkcodes.h>
-#include <gdk/gdkx.h>
-#endif

 #include "vinagre-rdp-tab.h"
 #include "vinagre-rdp-connection.h"
@@ -44,12 +39,6 @@

 #define SELECT_TIMEOUT 50

-#if !HAVE_FREERDP_1_1
-typedef boolean BOOL;
-typedef uint8   UINT8;
-typedef uint16  UINT16;
-#endif
-
 struct _VinagreRdpTabPrivate
 {
   freerdp         *freerdp_session;
@@ -476,16 +465,18 @@ frdp_drawing_area_draw (GtkWidget *area,
   return TRUE;
 }

-static void
+static BOOL
 frdp_begin_paint (rdpContext *context)
 {
   rdpGdi *gdi = context->gdi;

   gdi->primary->hdc->hwnd->invalid->null = 1;
   gdi->primary->hdc->hwnd->ninvalid = 0;
+
+  return TRUE;
 }

-static void
+static BOOL
 frdp_end_paint (rdpContext *context)
 {
   VinagreRdpTab        *rdp_tab = ((frdpContext *) context)->rdp_tab;
@@ -495,7 +486,7 @@ frdp_end_paint (rdpContext *context)
   gint                  x, y, w, h;

   if (gdi->primary->hdc->hwnd->invalid->null)
-    return;
+    return TRUE;

   x = gdi->primary->hdc->hwnd->invalid->x;
   y = gdi->primary->hdc->hwnd->invalid->y;
@@ -517,6 +508,8 @@ frdp_end_paint (rdpContext *context)
     {
       gtk_widget_queue_draw_area (priv->display, x, y, w, h);
     }
+
+  return TRUE;
 }

 static BOOL
@@ -524,7 +517,6 @@ frdp_pre_connect (freerdp *instance)
 {
   rdpSettings *settings = instance->settings;

-#if HAVE_FREERDP_1_1
   settings->OrderSupport[NEG_DSTBLT_INDEX] = TRUE;
   settings->OrderSupport[NEG_PATBLT_INDEX] = TRUE;
   settings->OrderSupport[NEG_SCRBLT_INDEX] = TRUE;
@@ -549,32 +541,6 @@ frdp_pre_connect (freerdp *instance)
   settings->OrderSupport[NEG_POLYGON_CB_INDEX] = FALSE;
   settings->OrderSupport[NEG_ELLIPSE_SC_INDEX] = FALSE;
   settings->OrderSupport[NEG_ELLIPSE_CB_INDEX] = FALSE;
-#else
-  settings->order_support[NEG_DSTBLT_INDEX] = true;
-  settings->order_support[NEG_PATBLT_INDEX] = true;
-  settings->order_support[NEG_SCRBLT_INDEX] = true;
-  settings->order_support[NEG_OPAQUE_RECT_INDEX] = true;
-  settings->order_support[NEG_DRAWNINEGRID_INDEX] = false;
-  settings->order_support[NEG_MULTIDSTBLT_INDEX] = false;
-  settings->order_support[NEG_MULTIPATBLT_INDEX] = false;
-  settings->order_support[NEG_MULTISCRBLT_INDEX] = false;
-  settings->order_support[NEG_MULTIOPAQUERECT_INDEX] = true;
-  settings->order_support[NEG_MULTI_DRAWNINEGRID_INDEX] = false;
-  settings->order_support[NEG_LINETO_INDEX] = true;
-  settings->order_support[NEG_POLYLINE_INDEX] = true;
-  settings->order_support[NEG_MEMBLT_INDEX] = true;
-  settings->order_support[NEG_MEM3BLT_INDEX] = false;
-  settings->order_support[NEG_MEMBLT_V2_INDEX] = true;
-  settings->order_support[NEG_MEM3BLT_V2_INDEX] = false;
-  settings->order_support[NEG_SAVEBITMAP_INDEX] = false;
-  settings->order_support[NEG_GLYPH_INDEX_INDEX] = true;
-  settings->order_support[NEG_FAST_INDEX_INDEX] = true;
-  settings->order_support[NEG_FAST_GLYPH_INDEX] = false;
-  settings->order_support[NEG_POLYGON_SC_INDEX] = false;
-  settings->order_support[NEG_POLYGON_CB_INDEX] = false;
-  settings->order_support[NEG_ELLIPSE_SC_INDEX] = false;
-  settings->order_support[NEG_ELLIPSE_CB_INDEX] = false;
-#endif

   return TRUE;
 }
@@ -587,15 +553,7 @@ frdp_post_connect (freerdp *instance)
   rdpGdi               *gdi;
   int                   stride;

-  gdi_init (instance,
-#if defined(FREERDP_VERSION_MAJOR) && defined(FREERDP_VERSION_MINOR) && \
-    !(FREERDP_VERSION_MAJOR > 1 || (FREERDP_VERSION_MAJOR == 1 && \
-    FREERDP_VERSION_MINOR >= 2))
-                    CLRBUF_24BPP,
-#else
-                    CLRBUF_32BPP,
-#endif
-                    NULL);
+  gdi_init (instance, PIXEL_FORMAT_BGRA32);
   gdi = instance->context->gdi;

   instance->update->BeginPaint = frdp_begin_paint;
@@ -705,21 +663,15 @@ frdp_key_pressed (GtkWidget   *widget,
   VinagreRdpTab        *rdp_tab = (VinagreRdpTab *) user_data;
   VinagreRdpTabPrivate *priv = rdp_tab->priv;
   frdpEventKey         *frdp_event;
-#if HAVE_FREERDP_1_1
   UINT16                scancode;
-#endif

   frdp_event = g_new0 (frdpEventKey, 1);
   frdp_event->type = FRDP_EVENT_TYPE_KEY;
   frdp_event->flags = event->type == GDK_KEY_PRESS ? KBD_FLAGS_DOWN : KBD_FLAGS_RELEASE;

-#if HAVE_FREERDP_1_1
   scancode = freerdp_keyboard_get_rdp_scancode_from_x11_keycode (event->hardware_keycode);
   frdp_event->code = RDP_SCANCODE_CODE(scancode);
   frdp_event->extended = RDP_SCANCODE_EXTENDED(scancode);
-#else
-  frdp_event->code = freerdp_kbd_get_scancode_by_keycode (event->hardware_keycode, &frdp_event->extended);
-#endif

   if (frdp_event->extended)
     frdp_event->flags |= KBD_FLAGS_EXTENDED;
@@ -934,11 +886,13 @@ frdp_authenticate (freerdp  *instance,
   return TRUE;
 }

-static BOOL
+static DWORD
 frdp_certificate_verify (freerdp *instance,
-                         char    *subject,
-                         char    *issuer,
-                         char    *fingerprint)
+                         const char *common_name,
+                         const char *subject,
+                         const char *issuer,
+                         const char *fingerprint,
+                         BOOL host_mismatch)
 {
   VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
   GtkBuilder *builder;
@@ -968,17 +922,18 @@ frdp_certificate_verify (freerdp *instance,
   gtk_widget_hide (dialog);

-  return response == GTK_RESPONSE_YES;
+  return (response == GTK_RESPONSE_YES) ? 1 : 0;
 }

-
-#if HAVE_FREERDP_1_1
-static BOOL
+static DWORD
 frdp_changed_certificate_verify (freerdp *instance,
-                                 char    *subject,
-                                 char    *issuer,
-                                 char    *new_fingerprint,
-                                 char    *old_fingerprint)
+                                 const char *common_name,
+                                 const char *subject,
+                                 const char *issuer,
+                                 const char *new_fingerprint,
+                                 const char *old_subject,
+                                 const char *old_issuer,
+                                 const char *old_fingerprint)
 {
   VinagreTab *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
   GtkBuilder *builder;
@@ -1023,9 +978,8 @@ frdp_changed_certificate_verify (freerdp *instance,
   gtk_widget_hide (dialog);

-  return response == GTK_RESPONSE_YES;
+  return (response == GTK_RESPONSE_YES) ? 1 : 0;
 }
-#endif

 static void
 init_freerdp (VinagreRdpTab *rdp_tab)
@@ -1053,15 +1007,9 @@ init_freerdp (VinagreRdpTab *rdp_tab)
   priv->freerdp_session->PostConnect = frdp_post_connect;
   priv->freerdp_session->Authenticate = frdp_authenticate;
   priv->freerdp_session->VerifyCertificate = frdp_certificate_verify;
-#if HAVE_FREERDP_1_1
   priv->freerdp_session->VerifyChangedCertificate = frdp_changed_certificate_verify;
-#endif

-#if HAVE_FREERDP_1_1
   priv->freerdp_session->ContextSize = sizeof (frdpContext);
-#else
-  priv->freerdp_session->context_size = sizeof (frdpContext);
-#endif

   freerdp_context_new (priv->freerdp_session);
   ((frdpContext *) priv->freerdp_session->context)->rdp_tab = rdp_tab;
@@ -1070,53 +1018,24 @@ init_freerdp (VinagreRdpTab *rdp_tab)
   settings = priv->freerdp_session->settings;

   /* Security settings */
-#if HAVE_FREERDP_1_1
   settings->RdpSecurity = TRUE;
   settings->TlsSecurity = TRUE;
   settings->NlaSecurity = TRUE;
   settings->EncryptionMethods = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
   settings->EncryptionLevel = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
-#else
-  settings->rdp_security = true;
-  settings->tls_security = true;
-  settings->nla_security = true;
-  settings->encryption = true;
-  settings->encryption_method = ENCRYPTION_METHOD_40BIT | ENCRYPTION_METHOD_128BIT | ENCRYPTION_METHOD_FIPS;
-  settings->encryption_level = ENCRYPTION_LEVEL_CLIENT_COMPATIBLE;
-#endif
-#include <freerdp/version.h>
-#if (FREERDP_VERSION_MAJOR == 1 && FREERDP_VERSION_MINOR >= 2 && FREERDP_VERSION_REVISION >= 1) || (FREERDP_VERSION_MAJOR == 2)
   settings->UseRdpSecurityLayer = FALSE;
-#else
-  settings->DisableEncryption = FALSE;
-#endif

   /* Set display size */
-#if HAVE_FREERDP_1_1
   settings->DesktopWidth = width;
   settings->DesktopHeight = height;
-#else
-  settings->width = width;
-  settings->height = height;
-#endif

   /* Set hostname */
-#if HAVE_FREERDP_1_1
   settings->WindowTitle = g_strdup (hostname);
   settings->ServerHostname = g_strdup (hostname);
   settings->ServerPort = port;
-#else
-  settings->window_title = g_strdup (hostname);
-  settings->hostname = g_strdup (hostname);
-  settings->port = port;
-#endif

   /* Set keyboard layout */
-#if HAVE_FREERDP_1_1
   freerdp_keyboard_init (KBD_US);
-#else
-  freerdp_kbd_init (GDK_DISPLAY_XDISPLAY (gdk_display_get_default ()), KBD_US);
-#endif

   /* Allow font smoothing by default */
   settings->AllowFontSmoothing = TRUE;
--
2.18.1


code:
https://gitlab.gnome.org/GNOME/vinagre/merge_requests/4.patch

From 141f9383129795da267a8111897fb3a0a324b080 Mon Sep 17 00:00:00 2001
From: Ondrej Holy <oholy@redhat.com>
Date: Thu, 22 Nov 2018 17:22:35 +0100
Subject: [PATCH 2/2] Handle new RDP certificate parameters

The freerdp2 certificate callbacks contains more parameters, let's
present some of them to user also.
---
 data/vinagre.ui               | 80 ++++++++++++++++++++++++++++++-----
 plugins/rdp/vinagre-rdp-tab.c | 26 +++++-------
 2 files changed, 80 insertions(+), 26 deletions(-)

diff --git a/data/vinagre.ui b/data/vinagre.ui
index 3135336..d7ce258 100644
--- a/data/vinagre.ui
+++ b/data/vinagre.ui
@@ -885,7 +885,7 @@ Do you trust the new certificate?</property>
                 <property name="vexpand">True</property>
                 <property name="xalign">0</property>
                 <property name="xpad">12</property>
-                <property name="label" translatable="yes" comments="Subject of the certificate.">Subject:</property>
+                <property name="label" translatable="yes" comments="Subject of the certificate.">New subject:</property>
               </object>
               <packing>
                 <property name="left_attach">0</property>
@@ -901,7 +901,7 @@ Do you trust the new certificate?</property>
                 <property name="vexpand">True</property>
                 <property name="xalign">0</property>
                 <property name="xpad">12</property>
-                <property name="label" translatable="yes" comments="Issuer of the certificate.">Issuer:</property>
+                <property name="label" translatable="yes" comments="Issuer of the certificate.">New issuer:</property>
               </object>
               <packing>
                 <property name="left_attach">0</property>
@@ -927,7 +927,55 @@ Do you trust the new certificate?</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="certificate_changed_subject">
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="vexpand">True</property>
+                <property name="xalign">0</property>
+                <property name="xpad">12</property>
+                <property name="label" translatable="yes" comments="Subject of the old certificate.">Old subject:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">3</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="vexpand">True</property>
+                <property name="xalign">0</property>
+                <property name="xpad">12</property>
+                <property name="label" translatable="yes" comments="Issuer of the old certificate.">Old issuer:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">4</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="vexpand">True</property>
+                <property name="xalign">0</property>
+                <property name="xpad">12</property>
+                <property name="label" translatable="yes" comments="Fingerprint of the old certificate.">Old fingerprint:</property>
+              </object>
+              <packing>
+                <property name="left_attach">0</property>
+                <property name="top_attach">5</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="certificate_changed_new_subject">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
@@ -942,7 +990,7 @@ Do you trust the new certificate?</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="certificate_changed_issuer">
+              <object class="GtkLabel" id="certificate_changed_new_issuer">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
                 <property name="hexpand">True</property>
@@ -972,21 +1020,33 @@ Do you trust the new certificate?</property>
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="certificate_changed_old_fingerprint_label">
+              <object class="GtkLabel" id="certificate_changed_old_subject">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>
-                <property name="vexpand">True</property>
+                <property name="hexpand">True</property>
                 <property name="xalign">0</property>
-                <property name="xpad">12</property>
-                <property name="label" translatable="yes" comments="Fingerprint of the old certificate.">Old fingerprint:</property>
               </object>
               <packing>
-                <property name="left_attach">0</property>
+                <property name="left_attach">1</property>
                 <property name="top_attach">3</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
             </child>
+            <child>
+              <object class="GtkLabel" id="certificate_changed_old_issuer">
+                <property name="visible">True</property>
+                <property name="can_focus">False</property>
+                <property name="hexpand">True</property>
+                <property name="xalign">0</property>
+              </object>
+              <packing>
+                <property name="left_attach">1</property>
+                <property name="top_attach">4</property>
+                <property name="width">1</property>
+                <property name="height">1</property>
+              </packing>
+            </child>
             <child>
               <object class="GtkLabel" id="certificate_changed_old_fingerprint">
                 <property name="visible">True</property>
@@ -997,7 +1057,7 @@ Do you trust the new certificate?</property>
               </object>
               <packing>
                 <property name="left_attach">1</property>
-                <property name="top_attach">3</property>
+                <property name="top_attach">5</property>
                 <property name="width">1</property>
                 <property name="height">1</property>
               </packing>
diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index 28e3eb6..30a8698 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -917,6 +917,7 @@ frdp_certificate_verify (freerdp *instance,
   widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_fingerprint"));
   gtk_label_set_text (GTK_LABEL (widget), fingerprint);

+  /* FIXME: Warn user in case of host_mismatch. */

   response = gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_hide (dialog);
@@ -939,7 +940,6 @@ frdp_changed_certificate_verify (freerdp *instance,
   GtkBuilder *builder;
   GtkWidget  *dialog;
   GtkWidget  *widget;
-  GtkWidget  *label;
   gint        response;

   builder = vinagre_utils_get_builder ();
@@ -950,29 +950,23 @@ frdp_changed_certificate_verify (freerdp *instance,
                           _("Connect"), GTK_RESPONSE_YES, NULL);
   gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_YES);

-  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_subject"));
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_new_subject"));
   gtk_label_set_text (GTK_LABEL (widget), subject);

-  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_issuer"));
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_new_issuer"));
   gtk_label_set_text (GTK_LABEL (widget), issuer);

   widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_new_fingerprint"));
   gtk_label_set_text (GTK_LABEL (widget), new_fingerprint);

-  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_fingerprint"));
-  label = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_fingerprint_label"));
-  if (old_fingerprint != NULL && old_fingerprint[0] != '\0')
-    {
-      gtk_label_set_text (GTK_LABEL (widget), old_fingerprint);
-      gtk_widget_show (widget);
-      gtk_widget_show (label);
-    }
-  else
-    {
-      gtk_widget_hide (widget);
-      gtk_widget_hide (label);
-    }
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_subject"));
+  gtk_label_set_text (GTK_LABEL (widget), old_subject);

+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_issuer"));
+  gtk_label_set_text (GTK_LABEL (widget), old_issuer);
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "certificate_changed_old_fingerprint"));
+  gtk_label_set_text (GTK_LABEL (widget), old_fingerprint);

   response = gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_hide (dialog);
--
2.18.1


code:
Fix CVE-2017-6386 (memory leak introduced by fix for CVE-2017-5994).

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5994

Patch copied from upstream source repository:

https://cgit.freedesktop.org/virglrenderer/commit/?id=737c3350850ca4dbc5633b3bdb4118176ce59920

From 737c3350850ca4dbc5633b3bdb4118176ce59920 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Tue, 28 Feb 2017 14:52:09 +1000
Subject: renderer: fix memory leak in vertex elements state create

Reported-by: Li Qiang
Free the vertex array in error path.
This was introduced by this commit:
renderer: fix heap overflow in vertex elements state create.

I rewrote the code to not require the allocation in the first
place if we have an error, seems nicer.

Signed-off-by: Dave Airlie <airlied@redhat.com>

diff --git a/src/vrend_renderer.c b/src/vrend_renderer.c
index 1bca7ad..e5d9f5c 100644
--- a/src/vrend_renderer.c
+++ b/src/vrend_renderer.c
@@ -1648,18 +1648,19 @@ int vrend_create_vertex_elements_state(struct vrend_context *ctx,
                                        unsigned num_elements,
                                        const struct pipe_vertex_element *elements)
 {
-   struct vrend_vertex_element_array *v = CALLOC_STRUCT(vrend_vertex_element_array);
+   struct vrend_vertex_element_array *v;
    const struct util_format_description *desc;
    GLenum type;
    int i;
    uint32_t ret_handle;

-   if (!v)
-      return ENOMEM;
-
    if (num_elements > PIPE_MAX_ATTRIBS)
       return EINVAL;

+   v = CALLOC_STRUCT(vrend_vertex_element_array);
+   if (!v)
+      return ENOMEM;
+
    v->count = num_elements;
    for (i = 0; i < num_elements; i++) {
       memcpy(&v->elements[i].base, &elements[i], sizeof(struct pipe_vertex_element));
--
cgit v0.10.2


code:
diff --git a/src/Makefile.am b/src/Makefile.am
index e56a8a2..4adcc48 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -3,7 +3,7 @@ bin_PROGRAMS = $(top_builddir)/bin/vsearch
 if TARGET_PPC
 AM_CXXFLAGS=-Wall -Wsign-compare -O3 -g -mcpu=power8
 else
-AM_CXXFLAGS=-Wall -Wsign-compare -O3 -g -march=x86-64 -mtune=generic
+AM_CXXFLAGS=-Wall -Wsign-compare -O3 -g -lcityhash
 endif

 AM_CFLAGS=$(AM_CXXFLAGS)
@@ -18,8 +18,6 @@ allpairs.h \
 arch.h \
 bitmap.h \
 chimera.h \
-city.h \
-citycrc.h \
 cluster.h \
 cpu.h \
 db.h \
@@ -59,31 +57,26 @@ xstring.h

 if TARGET_PPC
 libcpu_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
-noinst_LIBRARIES = libcpu.a libcityhash.a
+noinst_LIBRARIES = libcpu.a
 else
 libcpu_sse2_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
 libcpu_sse2_a_CXXFLAGS = $(AM_CXXFLAGS) -msse2
 libcpu_ssse3_a_SOURCES = cpu.cc $(VSEARCHHEADERS)
 libcpu_ssse3_a_CXXFLAGS = $(AM_CXXFLAGS) -mssse3 -DSSSE3
-noinst_LIBRARIES = libcpu_sse2.a libcpu_ssse3.a libcityhash.a
+noinst_LIBRARIES = libcpu_sse2.a libcpu_ssse3.a
 endif

-libcityhash_a_SOURCES = city.cc city.h
-
 if TARGET_WIN

-libcityhash_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-sign-compare -D_MSC_VER
-__top_builddir__bin_vsearch_LDFLAGS = -static
-__top_builddir__bin_vsearch_LDADD = libregex.a libcityhash.a libcpu_ssse3.a libcpu_sse2.a
+__top_builddir__bin_vsearch_LDFLAGS = -static -lcityhash
+__top_builddir__bin_vsearch_LDADD = libregex.a libcpu_ssse3.a libcpu_sse2.a

 else

-libcityhash_a_CXXFLAGS = $(AM_CXXFLAGS) -Wno-sign-compare
-
 if TARGET_PPC
-__top_builddir__bin_vsearch_LDADD = libcityhash.a libcpu.a
+__top_builddir__bin_vsearch_LDADD = libcpu.a
 else
-__top_builddir__bin_vsearch_LDADD = libcityhash.a libcpu_ssse3.a libcpu_sse2.a
+__top_builddir__bin_vsearch_LDADD = libcpu_ssse3.a libcpu_sse2.a
 endif

 endif
diff --git a/src/vsearch.h b/src/vsearch.h
index f2c244b..5f51bbe 100644
--- a/src/vsearch.h
+++ b/src/vsearch.h
@@ -148,7 +148,7 @@
 #include <bzlib.h>
 #endif

-#include "city.h"
+#include <city.h>
 #include "md5.h"
 #include "sha1.h"


code:
From feeee4b5832b17641e505b7083e0d299fdae318e Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@gnome.org>
Date: Sat, 19 May 2012 17:36:09 +0000
Subject: emulation: Limit integer arguments to 65535

To guard against malicious sequences containing excessively big numbers,
limit all parsed numbers to 16 bit range. Doing this here in the parsing
routine is a catch-all guard; this doesn't preclude enforcing
more stringent limits in the handlers themselves.

https://bugzilla.gnome.org/show_bug.cgi?id=676090
---
diff --git a/src/table.c b/src/table.c
index 140e8c8..85cf631 100644
--- a/src/table.c
+++ b/src/table.c
@@ -550,7 +550,7 @@ _vte_table_extract_numbers(GValueArray **array,
 		if (G_UNLIKELY (*array == NULL)) {
 			*array = g_value_array_new(1);
 		}
-		g_value_set_long(&value, total);
+		g_value_set_long(&value, CLAMP (total, 0, G_MAXUSHORT));
 		g_value_array_append(*array, &value);
 	} while (i++ < arginfo->length);
 	g_value_unset(&value);
diff --git a/src/vteseq.c b/src/vteseq.c
index 457c06a..46def5b 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -557,7 +557,7 @@ vte_sequence_handler_multiple(VteTerminal *terminal,
                               GValueArray *params,
                               VteTerminalSequenceHandler handler)
 {
-        vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXLONG);
+        vte_sequence_handler_multiple_limited(terminal, params, handler, G_MAXUSHORT);
 }

 static void
--
cgit v0.9.0.2


code:
From 98ce2f265f986fb88c38d508286bb5e3716b9e74 Mon Sep 17 00:00:00 2001
From: Christian Persch <chpe@gnome.org>
Date: Sat, 19 May 2012 18:04:12 +0000
Subject: emulation: Limit repetitions

Don't allow malicious sequences to cause excessive repetitions.

https://bugzilla.gnome.org/show_bug.cgi?id=676090
---
diff --git a/src/vteseq.c b/src/vteseq.c
index 46def5b..7fb4707 100644
--- a/src/vteseq.c
+++ b/src/vteseq.c
@@ -1397,7 +1397,7 @@ vte_sequence_handler_dc (VteTerminal *terminal, GValueArray *params)
 static void
 vte_sequence_handler_DC (VteTerminal *terminal, GValueArray *params)
 {
-	vte_sequence_handler_multiple(terminal, params, vte_sequence_handler_dc);
+	vte_sequence_handler_multiple_r(terminal, params, vte_sequence_handler_dc);
 }

 /* Delete a line at the current cursor position. */
@@ -1790,7 +1790,7 @@ vte_sequence_handler_reverse_index (VteTerminal *terminal, GValueArray *params)
 static void
 vte_sequence_handler_RI (VteTerminal *terminal, GValueArray *params)
 {
-	vte_sequence_handler_multiple(terminal, params, vte_sequence_handler_nd);
+	vte_sequence_handler_multiple_r(terminal, params, vte_sequence_handler_nd);
 }

 /* Save cursor (position). */
@@ -2782,8 +2782,7 @@ vte_sequence_handler_insert_lines (VteTerminal *terminal, GValueArray *params)
 {
 	GValue *value;
 	VteScreen *screen;
-	long param, end, row;
-	int i;
+	long param, end, row, i, limit;
 	screen = terminal->pvt->screen;
 	/* The default is one. */
 	param = 1;
@@ -2801,7 +2800,13 @@ vte_sequence_handler_insert_lines (VteTerminal *terminal, GValueArray *params)
 	} else {
 		end = screen->insert_delta + terminal->row_count - 1;
 	}
-	/* Insert the new lines at the cursor. */
+
+	/* Only allow to insert as many lines as there are between this row
+         * and the end of the scrolling region. See bug #676090.
+         */
+        limit = end - row + 1;
+        param = MIN (param, limit);
+
 	for (i = 0; i < param; i++) {
 		/* Clear a line off the end of the region and add one to the
 		 * top of the region. */
@@ -2822,8 +2827,7 @@ vte_sequence_handler_delete_lines (VteTerminal *terminal, GValueArray *params)
 {
 	GValue *value;
 	VteScreen *screen;
-	long param, end, row;
-	int i;
+	long param, end, row, i, limit;

 	screen = terminal->pvt->screen;
 	/* The default is one. */
@@ -2842,6 +2846,13 @@ vte_sequence_handler_delete_lines (VteTerminal *terminal, GValueArray *params)
 	} else {
 		end = screen->insert_delta + terminal->row_count - 1;
 	}
+
+        /* Only allow to delete as many lines as there are between this row
+         * and the end of the scrolling region. See bug #676090.
+         */
+        limit = end - row + 1;
+        param = MIN (param, limit);
+
 	/* Clear them from below the current cursor. */
 	for (i = 0; i < param; i++) {
 		/* Insert a line at the end of the region and remove one from
--
cgit v0.9.0.2


code:
This fixes a build failure in VTK when building against recent versions
of freetype.

  https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7432

Patch by Ben Boeckel <ben.boeckel@kitware.com>

Subject: [PATCH] vtkFreeTypeTools: avoid using an internal macro

This macro has been removed upstream as it was always intended to be
private.
---
 Rendering/FreeType/vtkFreeTypeTools.cxx | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/Rendering/FreeType/vtkFreeTypeTools.cxx b/Rendering/FreeType/vtkFreeTypeTools.cxx
index c54289dc60..03b899c4da 100644
--- a/Rendering/FreeType/vtkFreeTypeTools.cxx
+++ b/Rendering/FreeType/vtkFreeTypeTools.cxx
@@ -387,11 +387,8 @@ FTC_CMapCache* vtkFreeTypeTools::GetCMapCache()
 }

 //----------------------------------------------------------------------------
-FT_CALLBACK_DEF(FT_Error)
-vtkFreeTypeToolsFaceRequester(FTC_FaceID face_id,
-                              FT_Library lib,
-                              FT_Pointer request_data,
-                              FT_Face* face)
+static FT_Error vtkFreeTypeToolsFaceRequester(
+  FTC_FaceID face_id, FT_Library lib, FT_Pointer request_data, FT_Face* face)
 {
 #if VTK_FTFC_DEBUG_CD
   printf("vtkFreeTypeToolsFaceRequester()\n");
--
2.30.1


code:
This fixes a build failure in VTK when building against recent versions
of freetype.

  https://gitlab.kitware.com/vtk/vtk/-/merge_requests/7432

Patch by Ben Boeckel <ben.boeckel@kitware.com>

Subject: [PATCH] vtkFreeTypeTools: avoid using an internal macro

This macro has been removed upstream as it was always intended to be
private.
---
 Rendering/FreeType/vtkFreeTypeTools.cxx | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/Rendering/FreeType/vtkFreeTypeTools.cxx b/Rendering/FreeType/vtkFreeTypeTools.cxx
index c54289dc60..03b899c4da 100644
--- a/Rendering/FreeType/vtkFreeTypeTools.cxx
+++ b/Rendering/FreeType/vtkFreeTypeTools.cxx
@@ -378,8 +378,7 @@ FTC_CMapCache* vtkFreeTypeTools::GetCMapCache()
 }

 //----------------------------------------------------------------------------
-FT_CALLBACK_DEF(FT_Error)
-vtkFreeTypeToolsFaceRequester(
+static FT_Error vtkFreeTypeToolsFaceRequester(
   FTC_FaceID face_id, FT_Library lib, FT_Pointer request_data, FT_Face* face)
 {
 #if VTK_FTFC_DEBUG_CD
--
2.30.1


code:
diff --git a/source/ref_gl/r_imagelib.cpp b/source/ref_gl/r_imagelib.cpp
index 418028a..f76916b 100644
--- a/source/ref_gl/r_imagelib.cpp
+++ b/source/ref_gl/r_imagelib.cpp
@@ -762,7 +762,7 @@ static void q_jpg_noop( j_decompress_ptr cinfo ) {

 static boolean q_jpg_fill_input_buffer( j_decompress_ptr cinfo ) {
 	Com_DPrintf( "Premature end of jpeg file\n" );
-	return 1;
+	return TRUE;
 }

 static void q_jpg_skip_input_data( j_decompress_ptr cinfo, long num_bytes ) {
@@ -955,7 +955,7 @@ bool WriteJPG( const char *name, r_imginfo_t *info, int quality ) {
 	}

 	// start compression
-	qjpeg_start_compress( &cinfo, true );
+	qjpeg_start_compress( &cinfo, TRUE );

 	// feed scanline data
 	w3 = cinfo.image_width * info->samples;


code:
Add fonts from all XDG_DATA_DIRS, not just XDG_DATA_HOME.

See <http://bugs.gnu.org/41174>.
Author: Leo Prikler <leo.prikler@student.tugraz.at>
Index: webkitgtk-2.28.2/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
===================================================================
--- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
@@ -387,6 +387,7 @@ static void bindFonts(Vector<CString>& args)
     const char* homeDir = g_get_home_dir();
     const char* dataDir = g_get_user_data_dir();
     const char* cacheDir = g_get_user_cache_dir();
+    const char* const * dataDirs = g_get_system_data_dirs();

     // Configs can include custom dirs but then we have to parse them...
     GUniquePtr<char> fontConfig(g_build_filename(configDir, "fontconfig", nullptr));
@@ -403,6 +404,10 @@ static void bindFonts(Vector<CString>& args)
     bindIfExists(args, fontHomeConfigDir.get());
     bindIfExists(args, fontData.get());
     bindIfExists(args, fontHomeData.get());
+    for (auto dataDir = dataDirs; dataDir != nullptr && *dataDir != nullptr; dataDir++) {
+        GUniquePtr<char> fontDataDir(g_build_filename(*dataDir, "fonts", nullptr));
+        bindIfExists(args, fontDataDir.get());
+    }
     bindIfExists(args, "/var/cache/fontconfig"); // Used by Debian.
 }


code:
Tell bubblewrap to share the store.  Required for programs that use the
sandboxing features such as Epiphany.

See <https://bugs.gnu.org/40837>.
Author: Jack Hill <jackhill@jackhill.us>
---
diff --git a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
--- a/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
+++ b/Source/WebKit/UIProcess/Launcher/glib/BubblewrapLauncher.cpp
@@ -737,6 +737,9 @@ GRefPtr<GSubprocess> bubblewrapSpawn(GSubprocessLauncher* launcher, const Proces
         "--ro-bind-try", "/usr/local/share", "/usr/local/share",
         "--ro-bind-try", DATADIR, DATADIR,

+       // Bind mount the store inside the WebKitGTK sandbox.
+       "--ro-bind", "@storedir@", "@storedir@",
+
         // We only grant access to the libdirs webkit is built with and
         // guess system libdirs. This will always have some edge cases.
         "--ro-bind-try", "/lib", "/lib",


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Fri, 05 Jun 2020 18:37:51 +0200
Subject: [PATCH] gnu: websocketpp: Fix build with CMake >= 3.15.

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 57ed01e78..43c772d78 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -215,7 +215,7 @@
     set (Boost_USE_MULTITHREADED TRUE)
     set (Boost_ADDITIONAL_VERSIONS "1.39.0" "1.40.0" "1.41.0" "1.42.0" "1.43.0" "1.44.0" "1.46.1") # todo: someone who knows better spesify these!

-    find_package (Boost 1.39.0 COMPONENTS "${WEBSOCKETPP_BOOST_LIBS}")
+    find_package (Boost 1.39.0 COMPONENTS ${WEBSOCKETPP_BOOST_LIBS})

     if (Boost_FOUND)
         # Boost is a project wide global dependency.


code:
Fix copied from https://bugs.launchpad.net/wicd/+bug/1432423/comments/1

--- wicd-1.7.3/curses/netentry_curses.py	1969-12-31 19:00:00.000000000 -0500
+++ wicd-1.7.3/curses/netentry_curses.py	2015-08-11 23:26:19.999999649 -0400
@@ -538,11 +538,16 @@
         self.bitrates = wireless.GetAvailableBitrates()
         self.bitrates.append('auto')
         self.bitrate_combo.set_list(self.bitrates)
+
+        # bitrate property is sometimes None
+        chosen_bitrate = wireless.GetWirelessProperty(networkID, 'bitrate')
+        if chosen_bitrate not in self.bitrates:
+            chosen_bitrate = 'auto'
+
         self.bitrate_combo.set_focus(
-            self.bitrates.index(
-                wireless.GetWirelessProperty(networkID, 'bitrate')
-            )
+            self.bitrates.index(chosen_bitrate)
         )
+
         self.allow_lower_bitrates_chkbox.set_state(
             to_bool(self.format_entry(networkID, 'allow_lower_bitrates'))
         )


code:
Fix copied from https://bugs.launchpad.net/wicd/+bug/1421918/comments/2

--- wicd-1.7.3/curses/wicd-curses.py	2014-12-21 16:57:33 +0000
+++ wicd-1.7.3/curses/wicd-curses.py	2015-02-24 23:41:01 +0000
@@ -532,7 +532,10 @@
     def get_selected_profile(self):
         """Get the selected wired profile"""
         loc = self.get_focus()[1]
-        return self.theList[loc]
+        if len(self.theList) > loc:
+            return self.theList[loc]
+        else:
+            return self.theList[-1]

 class AdHocDialog(Dialog2):


code:
Update the wicd-curses client to work with urwid-1.3.  Based on a patch from:
http://technik.blogbasis.net/wicd-curses-fix-fuer-attributeerror-screen-object-no-attribute-get_input_nonblocking-04-12-2014

--- wicd-1.7.3/curses/wicd-curses.py.orig	2014-12-21 14:40:46.000000000 -0500
+++ wicd-1.7.3/curses/wicd-curses.py	2015-02-05 23:41:17.530901204 -0500
@@ -1153,9 +1153,10 @@
         if not ui._started:
             return False

-        input_data = ui.get_input_nonblocking()
+        ui.set_input_timeouts(max_wait=0)
+        input_data = ui.get_input()
         # Resolve any "alarms" in the waiting
-        self.handle_keys(input_data[1])
+        self.handle_keys(input_data)

         # Update the screen
         canvas = self.frame.render((self.size), True)


code:
Add a template for WPA2-TTLS, which is notably used by Eduroam.

--- a/encryption/templates/active
+++ b/encryption/templates/active
@@ -4,6 +4,7 @@ wpa-psk
 wpa-psk-hex
 wpa2-leap
 wpa2-peap
+wpa2-ttls
 wep-hex
 wep-passphrase
 wep-shared
diff --git a/encryption/templates/wpa2-ttls b/encryption/templates/wpa2-ttls
new file mode 100644
index 0000000..4f66a1e
--- /dev/null
+++ b/encryption/templates/wpa2-ttls
@@ -0,0 +1,20 @@
+name = WPA2-TTLS (used notably by Eduroam)
+author = various contributors
+version = 1
+require identity *Identity anonymous_identity *Anonymous_identity password *Password ca_cert *Path_to_CA_Cert
+protected password *Password
+-----
+ctrl_interface=/var/run/wpa_supplicant
+network={
+        ssid="$_ESSID"
+        scan_ssid=$_SCAN
+        proto=WPA2
+        key_mgmt=WPA-EAP
+        group=CCMP TKIP
+        eap=TTLS
+        identity="$_IDENTITY"
+        password="$_PASSWORD"
+        anonymous_identity="$_ANONYMOUS_IDENTITY"
+        ca_cert="$_CA_CERT"
+        phase2="auth=PAP"
+}


code:
Description: use the system-wide minizip instead of the embeeded one if found.
Forwarded-Upstream: It was provided by upstream: http://bazaar.launchpad.net/~widelands-dev/widelands/b19-debian/revision/8147
 .
 Thanks to Fòram na Gàidhlig for the patch.

=== modified file 'CMakeLists.txt'
---
 CMakeLists.txt                     |  1 +
 cmake/Modules/FindMinizip.cmake    | 37 +++++++++++++++++++++++++++++++++++++
 cmake/WlFunctions.cmake            |  8 ++++++++
 src/io/filesystem/CMakeLists.txt   |  2 +-
 src/io/filesystem/zip_filesystem.h |  6 ++++++
 src/third_party/CMakeLists.txt     | 20 +++++++++++---------
 6 files changed, 64 insertions(+), 10 deletions(-)

--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -142,6 +142,7 @@
 find_package(SDL2_mixer REQUIRED)
 find_package(SDL2_ttf REQUIRED)
 find_package(ZLIB REQUIRED)
+find_package(Minizip)
 if(${CMAKE_VERSION} VERSION_LESS 3.9.0)
     find_package(ICU_old REQUIRED)
 else()
--- /dev/null
+++ b/cmake/Modules/FindMinizip.cmake
@@ -0,0 +1,37 @@
+# - Try to find Minizip
+# Once done this will define
+#
+#  MINIZIP_FOUND        - system has MINIZIP
+#  MINIZIP_INCLUDE_DIR  - the MINIZIP include directory
+#  MINIZIP_LIBRARY_DIR  - where the libraries are
+#  MINIZIP_LIBRARY      - Link these to use MINIZIP
+#
+
+IF (MINIZIP_INCLUDE_DIR)
+  # Already in cache, be silent
+  SET(MINIZIP_FIND_QUIETLY TRUE)
+ENDIF (MINIZIP_INCLUDE_DIR)
+
+FIND_PATH( MINIZIP_INCLUDE_DIR
+	  NAMES zip.h unzip.h ioapi.h
+	  PATHS /usr/local/include /usr/include
+	  PATH_SUFFIXES minizip/ )
+SET( MINIZIP_NAMES minizip MINIZIP )
+FIND_LIBRARY( MINIZIP_LIBRARY
+	      NAMES ${MINIZIP_NAMES}
+	      PATHS /usr/lib /usr/local/lib )
+
+GET_FILENAME_COMPONENT( MINIZIP_LIBRARY_DIR ${MINIZIP_LIBRARY} PATH )
+
+IF (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY)
+   SET(MINIZIP_FOUND TRUE)
+   SET(MINIZIP_LIBRARY_DIR ${MINIZIP_LIBRARY} )
+   IF (NOT MINIZIP_FIND_QUIETLY)
+     MESSAGE (STATUS "Found Minizip: ${MINIZIP_LIBRARY} ${MINIZIP_INCLUDE_DIR}")
+   ENDIF (NOT MINIZIP_FIND_QUIETLY)
+ELSE (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY)
+   SET( MINIZIP_FOUND FALSE )
+   SET( MINIZIP_LIBRARY_DIR )
+   SET( MINIZIP_EXTRA_DEFINITIONS )
+ENDIF (MINIZIP_INCLUDE_DIR AND MINIZIP_LIBRARY)
+
--- a/cmake/WlFunctions.cmake
+++ b/cmake/WlFunctions.cmake
@@ -84,6 +84,14 @@

   if(ARG_USES_ZLIB)
     target_link_libraries(${NAME} ZLIB::ZLIB)
+    if (MINIZIP_FOUND)
+      wl_include_system_directories(${NAME}  ${MINIZIP_INCLUDE_DIR})
+      target_link_libraries(${NAME}  ${MINIZIP_LIBRARY})
+      target_compile_definitions(${NAME} PUBLIC -DHAVE_SYSTEM_MINIZIP)
+    else(MINIZIP_FOUND)
+      target_link_libraries(${NAME}  third_party_minizip)
+      message(FATAL_ERROR "You are using widelands-bundled minizip sources. Please install your distribution's minizip dev library or urge your distribution maintainer to include the minizip library in your package repository. Thank you.")
+    endif(MINIZIP_FOUND)
   endif()

   # OpenGL and GLEW are one thing for us. If you use the one, you also use the
--- a/src/third_party/CMakeLists.txt
+++ b/src/third_party/CMakeLists.txt
@@ -1,12 +1,14 @@
-wl_library(third_party_minizip
-  THIRD_PARTY
-  SRCS
-    minizip/ioapi.h
-    minizip/unzip.cc
-    minizip/unzip.h
-    minizip/zip.h
-  USES_ZLIB
-)
+if(NOT MINIZIP_FOUND)
+  wl_library(third_party_minizip
+    THIRD_PARTY
+    SRCS
+      ioapi.h
+      unzip.cc
+      unzip.h
+      zip.h
+    USES_ZLIB
+  )
+endif(NOT MINIZIP_FOUND)

 wl_library(third_party_eris
   THIRD_PARTY
--- a/src/io/filesystem/CMakeLists.txt
+++ b/src/io/filesystem/CMakeLists.txt
@@ -12,6 +12,7 @@
     zip_exceptions.h
     zip_filesystem.cc
     zip_filesystem.h
+  USES_ZLIB
   DEPENDS
     base_exceptions
     base_i18n
@@ -19,5 +20,4 @@
     base_macros
     graphic_text_layout
     io_stream
-    third_party_minizip
 )
--- a/src/io/filesystem/zip_filesystem.h
+++ b/src/io/filesystem/zip_filesystem.h
@@ -25,8 +25,14 @@
 #include "io/filesystem/filesystem.h"
 #include "io/streamread.h"
 #include "io/streamwrite.h"
+
+#ifndef HAVE_SYSTEM_MINIZIP
 #include "third_party/minizip/unzip.h"
 #include "third_party/minizip/zip.h"
+#else
+#include <minizip/unzip.h>
+#include <minizip/zip.h>
+#endif

 class ZipFilesystem : public FileSystem {
 public:


code:
Description: Correct 64 Architecture implementation of 32 bit data
Author: Chris Donoghue <cdonoghu@gmail.com>
Bug-Debian: http://bugs.debian.org/362068

--- wmctrl-1.07.orig/main.c
+++ wmctrl-1.07/main.c
@@ -1425,6 +1425,16 @@ static gchar *get_property (Display *dis
      *
      * long_length = Specifies the length in 32-bit multiples of the
      *               data to be retrieved.
+     *
+     * NOTE:  see
+     * http://mail.gnome.org/archives/wm-spec-list/2003-March/msg00067.html
+     * In particular:
+     *
+     * 	When the X window system was ported to 64-bit architectures, a
+     * rather peculiar design decision was made. 32-bit quantities such
+     * as Window IDs, atoms, etc, were kept as longs in the client side
+     * APIs, even when long was changed to 64 bits.
+     *
      */
     if (XGetWindowProperty(disp, win, xa_prop_name, 0, MAX_PROPERTY_VALUE_LEN / 4, False,
             xa_prop_type, &xa_ret_type, &ret_format,
@@ -1441,6 +1451,8 @@ static gchar *get_property (Display *dis

     /* null terminate the result to make string handling easier */
     tmp_size = (ret_format / 8) * ret_nitems;
+    /* Correct 64 Architecture implementation of 32 bit data */
+    if(ret_format==32) tmp_size *= sizeof(long)/4;
     ret = g_malloc(tmp_size + 1);
     memcpy(ret, ret_prop, tmp_size);
     ret[tmp_size] = '\0';


code:
This patch comes from Debian and was modified by Kei Kebreau <kkebreau@posteo.net>.
Link: https://anonscm.debian.org/cgit/pkg-wmaker/wmfire.git/plain/debian/patches/gdk_updates.patch?h=debian/1.2.4-2&id=a272234fc5eecdbfc469adb12133196bc62f3059

Description: Update for newer versions of GDK.
 In particular, the icon window was not receiving enter and leave events from
 the pointer.  To fix this, we get rid of the second GdkWindow iconwin entirely
 and set win to be its own icon.
 .
 This also removes the need for the "broken window manager" fix, so we remove it
 and all references to it.
Author: Doug Torrance <dtorrance@piedmont.edu>

diff -ur wmfire-1.2.4.old/src/wmfire.c wmfire-1.2.4/src/wmfire.c
--- wmfire-1.2.4.old/src/wmfire.c	2017-04-23 14:26:58.449487117 -0400
+++ wmfire-1.2.4/src/wmfire.c	2017-04-23 14:32:10.785238671 -0400
@@ -77,7 +77,6 @@
 typedef struct {
 	Display *display;	/* X11 display */
 	GdkWindow *win;		/* Main window */
-	GdkWindow *iconwin;	/* Icon window */
 	GdkGC *gc;		/* Drawing GC */
 	GdkPixmap *pixmap;	/* Main pixmap */
 	GdkBitmap *mask;	/* Dockapp mask */
@@ -141,7 +140,6 @@
 int cmap = 0;
 int lock = 0;
 int proximity = 0;
-int broken_wm = 0;

 /******************************************/
 /* Main                                   */
@@ -262,12 +260,8 @@
 		usleep(REFRESH);

 		/* Draw the rgb buffer to screen */
-		if (!broken_wm)
-			gdk_draw_rgb_image(bm.iconwin, bm.gc, 4, 4, XMAX, YMAX, GDK_RGB_DITHER_NONE, bm.rgb, XMAX * 3);
-		else
-			gdk_draw_rgb_image(bm.win, bm.gc, 4, 4, XMAX, YMAX, GDK_RGB_DITHER_NONE, bm.rgb, XMAX * 3);
+                gdk_draw_rgb_image(bm.win, bm.gc, 4, 4, XMAX, YMAX, GDK_RGB_DITHER_NONE, bm.rgb, XMAX * 3);
 	}
-
 	return 0;
 }

@@ -556,9 +550,7 @@
 #define MASK GDK_BUTTON_PRESS_MASK | GDK_ENTER_NOTIFY_MASK | GDK_LEAVE_NOTIFY_MASK | GDK_POINTER_MOTION_HINT_MASK

 	GdkWindowAttr attr;
-	GdkWindowAttr attri;
 	Window win;
-	Window iconwin;

 	GdkPixmap *icon;

@@ -578,10 +570,6 @@
 	attr.wmclass_class = "wmfire";
 	attr.window_type = GDK_WINDOW_TOPLEVEL;

-	/* Make a copy for the iconwin - parameters are the same */
-	memcpy(&attri, &attr, sizeof (GdkWindowAttr));
-	attri.window_type = GDK_WINDOW_CHILD;
-
 	sizehints.flags = USSize;
 	sizehints.width = 64;
 	sizehints.height = 64;
@@ -592,18 +580,11 @@
 		exit(1);
 	}

-	bm.iconwin = gdk_window_new(bm.win, &attri, GDK_WA_TITLE | GDK_WA_WMCLASS);
-	if (!bm.iconwin) {
-		fprintf(stderr, "FATAL: Cannot make icon window\n");
-		exit(1);
-	}
-
 	win = GDK_WINDOW_XWINDOW(bm.win);
-	iconwin = GDK_WINDOW_XWINDOW(bm.iconwin);
 	XSetWMNormalHints(GDK_WINDOW_XDISPLAY(bm.win), win, &sizehints);

 	wmhints.initial_state = WithdrawnState;
-	wmhints.icon_window = iconwin;
+	wmhints.icon_window = win;
 	wmhints.icon_x = 0;
 	wmhints.icon_y = 0;
 	wmhints.window_group = win;
@@ -613,10 +594,8 @@

 	bm.pixmap = gdk_pixmap_create_from_xpm_d(bm.win, &(bm.mask), NULL, master_xpm);
 	gdk_window_shape_combine_mask(bm.win, bm.mask, 0, 0);
-	gdk_window_shape_combine_mask(bm.iconwin, bm.mask, 0, 0);

 	gdk_window_set_back_pixmap(bm.win, bm.pixmap, False);
-	gdk_window_set_back_pixmap(bm.iconwin, bm.pixmap, False);

 #if 0
         gdk_window_set_type_hint(bm.win, GDK_WINDOW_TYPE_HINT_DOCK);
@@ -626,7 +605,6 @@
 #endif

 	icon = gdk_pixmap_create_from_xpm_d(bm.win, NULL, NULL, icon_xpm);
-	gdk_window_set_icon(bm.win, bm.iconwin, icon, NULL);

 	gdk_window_show(bm.win);

@@ -721,9 +699,6 @@
 		case 'l':
 			lock = 1;
 			break;
-		case 'b':
-			broken_wm = 1;
-			break;
 		case 'h':
 		default:
 			do_help();
@@ -766,6 +741,5 @@
 	for (i = 0; i < NFLAMES; i++)
 		fprintf(stderr, "%d:%s ", i + 1, fire[i].text);
 	fprintf(stderr, "\n\t-l\t\t\tlock flame colour and monitor\n");
-	fprintf(stderr, "\t-b\t\t\tactivate broken window manager fix\n");
 	fprintf(stderr, "\t-h\t\t\tprints this help\n");
 }
Only in wmfire-1.2.4/src: wmfire.c~
diff -ur wmfire-1.2.4.old/wmfire.1 wmfire-1.2.4/wmfire.1
--- wmfire-1.2.4.old/wmfire.1	2017-04-23 14:26:58.449487117 -0400
+++ wmfire-1.2.4/wmfire.1	2017-04-23 14:41:20.697186114 -0400
@@ -8,7 +8,6 @@

 .SH SYNOPSIS
 .B wmfire
-[-b]
 [-c CPU]
 [-f COLOUR]
 [-F FILE]
@@ -54,9 +53,6 @@

 .SH OPTIONS
 .TP
-.B -b
-Activate broken window manager fix (if grey box diplayed)
-.TP
 .B -c [0..3]
 .br
 Monitor SMP CPU number X


code:
Fix CVE-2008-2149: buffer overflows by limiting the length of the string in sprintf
format string
Closes: #481186 (CVE-2008-2149)
Please note: The WordNet code contains several other occurences of potentially
exploitable functions like strcpy()/strcat()/...  and so even if there are no
known exploits the code needs a full security audit.

--- a/src/wn.c
+++ b/src/wn.c
@@ -206,7 +206,8 @@ static int searchwn(int ac, char *av[])
 		    outsenses += do_search(av[1], optptr->pos, optptr->search,
 					    whichsense, optptr->label);
 	    } else {
-		sprintf(tmpbuf, "wn: invalid search option: %s\n", av[j]);
+		/* Fix CVE-2008-2149: buffer overflows Andreas Tille <tille@debian.org> */
+		sprintf(tmpbuf, "wn: invalid search option: %.200s\n", av[j]);
 		display_message(tmpbuf);
 		errcount++;
 	    }


code:
Author: Anton Gladky <gladk@debian.org>
LastChanged: Tue, 26 Feb 2013 20:40:25 +0100
BugDebian: http://bugs.debian.org/700914
Description: This patch was created by oCert according to
  http://www.ocert.org/advisories/ocert-2008-014.html
 and can be downloaded from
  http://www.ocert.org/analysis/2008-014/wordnet.patch
 Unfortunately the original patch had a problem which
 caused 'wordnet test -synsn' to fail.  The critical
 part of the patch was removed from the whole patch
 set and is moved to 51_overflows_memcpy.patch which
 uses memcpy instead of the formerly used strcpy.

--- a/lib/binsrch.c
+++ b/lib/binsrch.c
@@ -28,7 +28,7 @@ char *read_index(long offset, FILE *fp)
     char *linep;

     linep = line;
-    line[0] = '0';
+    line[0] = '\0';

     fseek( fp, offset, SEEK_SET );
     fgets(linep, LINE_LEN, fp);
@@ -58,6 +58,8 @@ char *bin_search(char *searchkey, FILE *
         last_bin_search_offset = ftell( fp );
 	fgets(linep, LINE_LEN, fp);
 	length = (int)(strchr(linep, ' ') - linep);
+	if (length > (sizeof(key) - 1))
+            return(NULL);
 	strncpy(key, linep, length);
 	key[length] = '\0';
 	if(strcmp(key, searchkey) < 0) {
@@ -110,6 +112,8 @@ static int bin_search_key(char *searchke
 	line[length++] =  c;
     if (getc(fp) == EOF) {	/* only 1 line in file */
 	length = (int)(strchr(linep, ' ') - linep);
+	if (length > (sizeof(key) - 1))
+            return(0);
 	strncpy(key, linep, length);
 	key[length] = '\0';
 	if(strcmp(key, searchkey) > 0) {
@@ -132,6 +136,8 @@ static int bin_search_key(char *searchke
 	if (fgets(linep, LINE_LEN, fp) != NULL) {
   	    offset2 = ftell(fp); /* offset at start of next line */
 	    length = (int)(strchr(linep, ' ') - linep);
+	    if (length > (sizeof(key) - 1))
+                return(0);
 	    strncpy(key, linep, length);
 	    key[length] = '\0';
 	    if(strcmp(key, searchkey) < 0) {	/* further in file */
--- a/lib/morph.c
+++ b/lib/morph.c
@@ -51,21 +51,21 @@ static struct {
     char *str;
     int strlen;
 } prepositions[NUMPREPS] = {
-    "to", 2,
-    "at", 2,
-    "of", 2,
-    "on", 2,
-    "off", 3,
-    "in", 2,
-    "out", 3,
-    "up", 2,
-    "down", 4,
-    "from", 4,
-    "with", 4,
-    "into", 4,
-    "for", 3,
-    "about", 5,
-    "between", 7,
+    { "to", 2 },
+    { "at", 2 },
+    { "of", 2 },
+    { "on", 2 },
+    { "off", 3 },
+    { "in", 2 },
+    { "out", 3 },
+    { "up", 2 },
+    { "down", 4 },
+    { "from", 4 },
+    { "with", 4 },
+    { "into", 4 },
+    { "for", 3 },
+    { "about", 5 },
+    { "between", 7 }
 };

 static FILE *exc_fps[NUMPARTS + 1];
@@ -144,18 +144,19 @@ static int do_init(void)
     } else
 	sprintf(searchdir, DEFAULTPATH);
 #else
-    if ((env = getenv("WNSEARCHDIR")) != NULL)
-	strcpy(searchdir, env);
-    else if ((env = getenv("WNHOME")) != NULL)
-	sprintf(searchdir, "%s%s", env, DICTDIR);
-    else
+    if ((env = getenv("WNSEARCHDIR")) != NULL) {
+	snprintf(searchdir, sizeof(searchdir), "%s", env);
+    } else if ((env = getenv("WNHOME")) != NULL) {
+	snprintf(searchdir, sizeof(searchdir), "%s%s", env, DICTDIR);
+    } else {
 	strcpy(searchdir, DEFAULTPATH);
+    }
 #endif

     for (i = 1; i <= NUMPARTS; i++) {
-	sprintf(fname, EXCFILE, searchdir, partnames[i]);
+	snprintf(fname, sizeof(fname), EXCFILE, searchdir, partnames[i]);
 	if ((exc_fps[i] = fopen(fname, "r")) == NULL) {
-	    sprintf(msgbuf,
+	    snprintf(msgbuf, sizeof(msgbuf),
 		    "WordNet library error: Can't open exception file(%s)\n\n",
 		    fname);
 	    display_message(msgbuf);
@@ -178,13 +179,16 @@ char *morphstr(char *origstr, int pos)
     int prep;
     char *end_idx1, *end_idx2;
     char *append;
-
+
     if (pos == SATELLITE)
 	pos = ADJ;

     /* First time through for this string */

     if (origstr != NULL) {
+        if (strlen(origstr) > WORDBUF - 1)
+            return(NULL);
+
 	/* Assume string hasn't had spaces substitued with '_' */
 	strtolower(strsubst(strcpy(str, origstr), ' ', '_'));
 	searchstr[0] = '\0';
@@ -232,7 +236,7 @@ char *morphstr(char *origstr, int pos)
 		if (end_idx < 0) return(NULL);		/* shouldn't do this */
 		strncpy(word, str + st_idx, end_idx - st_idx);
 		word[end_idx - st_idx] = '\0';
-		if(tmp = morphword(word, pos))
+		if ((tmp = morphword(word, pos)) != NULL)
 		    strcat(searchstr,tmp);
 		else
 		    strcat(searchstr,word);
@@ -240,7 +244,7 @@ char *morphstr(char *origstr, int pos)
 		st_idx = end_idx + 1;
 	    }

-	    if(tmp = morphword(strcpy(word, str + st_idx), pos))
+	    if ((tmp = morphword(strcpy(word, str + st_idx), pos)) != NULL)
 		strcat(searchstr,tmp);
 	    else
 		strcat(searchstr,word);
@@ -270,16 +274,15 @@ char *morphword(char *word, int pos)
 {
     int offset, cnt;
     int i;
-    static char retval[WORDBUF];
-    char *tmp, tmpbuf[WORDBUF], *end;
-
-    sprintf(retval,"");
-    sprintf(tmpbuf, "");
-    end = "";
-
+    static char retval[WORDBUF] = "";
+    char *tmp, tmpbuf[WORDBUF] = "", *end = "";
+
     if(word == NULL)
 	return(NULL);

+    if (strlen(word) > WORDBUF - 1)
+        return(NULL);
+
     /* first look for word on exception list */

     if((tmp = exc_lookup(word, pos)) != NULL)
@@ -335,7 +338,10 @@ static char *wordbase(char *word, int en
 {
     char *pt1;
     static char copy[WORDBUF];
-
+
+    if (strlen(word) > WORDBUF - 1)
+        return(NULL);
+
     strcpy(copy, word);
     if(strend(copy,sufx[ender])) {
 	pt1=strchr(copy,'\0');
@@ -368,13 +374,14 @@ static char *exc_lookup(char *word, int
 {
     static char line[WORDBUF], *beglp, *endlp;
     char *excline;
-    int found = 0;

     if (exc_fps[pos] == NULL)
 	return(NULL);

     /* first time through load line from exception file */
     if(word != NULL){
+        if (strlen(word) > WORDBUF - 1)
+           return(NULL);
 	if ((excline = bin_search(word, exc_fps[pos])) != NULL) {
 	    strcpy(line, excline);
 	    endlp = strchr(line,' ');
@@ -403,6 +410,9 @@ static char *morphprep(char *s)
     char word[WORDBUF], end[WORDBUF];
     static char retval[WORDBUF];

+    if (strlen(s) > WORDBUF - 1)
+        return (NULL);
+
     /* Assume that the verb is the first word in the phrase.  Strip it
        off, check for validity, then try various morphs with the
        rest of the phrase tacked on, trying to find a match. */
@@ -410,7 +420,7 @@ static char *morphprep(char *s)
     rest = strchr(s, '_');
     last = strrchr(s, '_');
     if (rest != last) {		/* more than 2 words */
-	if (lastwd = morphword(last + 1, NOUN)) {
+	if ((lastwd = morphword(last + 1, NOUN)) != NULL) {
 	    strncpy(end, rest, last - rest + 1);
 	    end[last-rest+1] = '\0';
 	    strcat(end, lastwd);
--- a/lib/search.c
+++ b/lib/search.c
@@ -13,6 +13,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <assert.h>
+#include <limits.h>

 #include "wn.h"

@@ -119,33 +120,22 @@ IndexPtr parse_index(long offset, int db
     if ( !line )
       line = read_index( offset, indexfps[dbase] );

-    idx = (IndexPtr)malloc(sizeof(Index));
+    idx = (IndexPtr)calloc(1, sizeof(Index));
     assert(idx);

     /* set offset of entry in index file */
     idx->idxoffset = offset;

-    idx->wd='\0';
-    idx->pos='\0';
-    idx->off_cnt=0;
-    idx->tagged_cnt = 0;
-    idx->sense_cnt=0;
-    idx->offset='\0';
-    idx->ptruse_cnt=0;
-    idx->ptruse='\0';
-
     /* get the word */
     ptrtok=strtok(line," \n");

-    idx->wd = malloc(strlen(ptrtok) + 1);
+    idx->wd = strdup(ptrtok);
     assert(idx->wd);
-    strcpy(idx->wd, ptrtok);

     /* get the part of speech */
     ptrtok=strtok(NULL," \n");
-    idx->pos = malloc(strlen(ptrtok) + 1);
+    idx->pos = strdup(ptrtok);
     assert(idx->pos);
-    strcpy(idx->pos, ptrtok);

     /* get the collins count */
     ptrtok=strtok(NULL," \n");
@@ -154,7 +144,12 @@ IndexPtr parse_index(long offset, int db
     /* get the number of pointers types */
     ptrtok=strtok(NULL," \n");
     idx->ptruse_cnt = atoi(ptrtok);
-
+
+    if (idx->ptruse_cnt < 0 || (unsigned int)idx->ptruse_cnt > UINT_MAX/sizeof(int)) {
+        free_index(idx);
+        return(NULL);
+    }
+
     if (idx->ptruse_cnt) {
 	idx->ptruse = (int *) malloc(idx->ptruse_cnt * (sizeof(int)));
 	assert(idx->ptruse);
@@ -173,9 +168,14 @@ IndexPtr parse_index(long offset, int db
     /* get the number of senses that are tagged */
     ptrtok=strtok(NULL," \n");
     idx->tagged_cnt = atoi(ptrtok);
-
+
+    if (idx->off_cnt < 0 || (unsigned long)idx->off_cnt > ULONG_MAX/sizeof(long)) {
+        free_index(idx);
+        return(NULL);
+    }
+
     /* make space for the offsets */
-    idx->offset = (long *) malloc(idx->off_cnt * (sizeof(long)));
+    idx->offset = (unsigned long *) malloc(idx->off_cnt * sizeof(long));
     assert(idx->offset);

     /* get the offsets */
@@ -197,15 +197,21 @@ IndexPtr getindex(char *searchstr, int d
     char strings[MAX_FORMS][WORDBUF]; /* vector of search strings */
     static IndexPtr offsets[MAX_FORMS];
     static int offset;
-
+
     /* This works like strrok(): if passed with a non-null string,
        prepare vector of search strings and offsets.  If string
        is null, look at current list of offsets and return next
        one, or NULL if no more alternatives for this word. */

     if (searchstr != NULL) {
+        /* Bail out if the input is too long for us to handle */
+        if (strlen(searchstr) > (WORDBUF - 1)) {
+            strcpy(msgbuf, "WordNet library error: search term is too long\n");
+                   display_message(msgbuf);
+            return(NULL);
+        }

-	offset = 0;
+    	offset = 0;
 	strtolower(searchstr);
 	for (i = 0; i < MAX_FORMS; i++) {
 	    strcpy(strings[i], searchstr);
@@ -229,11 +235,11 @@ IndexPtr getindex(char *searchstr, int d
 	/* Get offset of first entry.  Then eliminate duplicates
 	   and get offsets of unique strings. */

-	if (strings[0][0] != NULL)
+	if (strings[0] != NULL)
 	    offsets[0] = index_lookup(strings[0], dbase);

 	for (i = 1; i < MAX_FORMS; i++)
-	    if ((strings[i][0]) != NULL && (strcmp(strings[0], strings[i])))
+	    if (strings[i] != NULL && (strcmp(strings[0], strings[i])))
 		offsets[i] = index_lookup(strings[i], dbase);
     }

@@ -272,7 +278,7 @@ SynsetPtr read_synset(int dbase, long bo
 SynsetPtr parse_synset(FILE *fp, int dbase, char *word)
 {
     static char line[LINEBUF];
-    char tbuf[SMLINEBUF];
+    char tbuf[SMLINEBUF] = "";
     char *ptrtok;
     char *tmpptr;
     int foundpert = 0;
@@ -286,33 +292,11 @@ SynsetPtr parse_synset(FILE *fp, int dba
     if ((tmpptr = fgets(line, LINEBUF, fp)) == NULL)
 	return(NULL);

-    synptr = (SynsetPtr)malloc(sizeof(Synset));
+    synptr = (SynsetPtr)calloc(1, sizeof(Synset));
     assert(synptr);
-
-    synptr->hereiam = 0;
+
     synptr->sstype = DONT_KNOW;
-    synptr->fnum = 0;
-    synptr->pos = '\0';
-    synptr->wcount = 0;
-    synptr->words = '\0';
-    synptr->whichword = 0;
-    synptr->ptrcount = 0;
-    synptr->ptrtyp = '\0';
-    synptr->ptroff = '\0';
-    synptr->ppos = '\0';
-    synptr->pto = '\0';
-    synptr->pfrm = '\0';
-    synptr->fcount = 0;
-    synptr->frmid = '\0';
-    synptr->frmto = '\0';
-    synptr->defn = '\0';
-    synptr->key = 0;
-    synptr->nextss = NULL;
-    synptr->nextform = NULL;
     synptr->searchtype = -1;
-    synptr->ptrlist = NULL;
-    synptr->headword = NULL;
-    synptr->headsense = 0;

     ptrtok = line;

@@ -322,7 +306,7 @@ SynsetPtr parse_synset(FILE *fp, int dba

     /* sanity check - make sure starting file offset matches first field */
     if (synptr->hereiam != loc) {
-	sprintf(msgbuf, "WordNet library error: no synset at location %d\n",
+	sprintf(msgbuf, "WordNet library error: no synset at location %ld\n",
 		loc);
 	display_message(msgbuf);
 	free(synptr);
@@ -335,16 +319,20 @@ SynsetPtr parse_synset(FILE *fp, int dba

     /* looking at POS */
     ptrtok = strtok(NULL, " \n");
-    synptr->pos = malloc(strlen(ptrtok) + 1);
+    synptr->pos = strdup(ptrtok);
     assert(synptr->pos);
-    strcpy(synptr->pos, ptrtok);
     if (getsstype(synptr->pos) == SATELLITE)
 	synptr->sstype = INDIRECT_ANT;

     /* looking at numwords */
     ptrtok = strtok(NULL, " \n");
     synptr->wcount = strtol(ptrtok, NULL, 16);
-
+
+    if (synptr->wcount < 0 || (unsigned int)synptr->wcount > UINT_MAX/sizeof(char *)) {
+        free_syns(synptr);
+        return(NULL);
+    }
+
     synptr->words = (char **)malloc(synptr->wcount  * sizeof(char *));
     assert(synptr->words);
     synptr->wnsns = (int *)malloc(synptr->wcount * sizeof(int));
@@ -354,9 +342,8 @@ SynsetPtr parse_synset(FILE *fp, int dba

     for (i = 0; i < synptr->wcount; i++) {
 	ptrtok = strtok(NULL, " \n");
-	synptr->words[i] = malloc(strlen(ptrtok) + 1);
+	synptr->words[i] = strdup(ptrtok);
 	assert(synptr->words[i]);
-	strcpy(synptr->words[i], ptrtok);

 	/* is this the word we're looking for? */

@@ -371,6 +358,12 @@ SynsetPtr parse_synset(FILE *fp, int dba
     ptrtok = strtok(NULL," \n");
     synptr->ptrcount = atoi(ptrtok);

+    /* Should we check for long here as well? */
+    if (synptr->ptrcount < 0 || (unsigned int)synptr->ptrcount > UINT_MAX/sizeof(int)) {
+        free_syns(synptr);
+        return(NULL);
+    }
+
     if (synptr->ptrcount) {

 	/* alloc storage for the pointers */
@@ -455,21 +448,23 @@ SynsetPtr parse_synset(FILE *fp, int dba
     ptrtok = strtok(NULL," \n");
     if (ptrtok) {
 	ptrtok = strtok(NULL," \n");
-	sprintf(tbuf, "");
 	while (ptrtok != NULL) {
+	    if (strlen(ptrtok) + strlen(tbuf) + 1 + 1 > sizeof(tbuf)) {
+                free_syns(synptr);
+                return(NULL);
+	    }
 	    strcat(tbuf,ptrtok);
 	    ptrtok = strtok(NULL, " \n");
 	    if(ptrtok)
 		strcat(tbuf," ");
 	}
-	assert((1 + strlen(tbuf)) < sizeof(tbuf));
-	synptr->defn = malloc(strlen(tbuf) + 4);
+	synptr->defn = malloc(strlen(tbuf) + 3);
 	assert(synptr->defn);
 	sprintf(synptr->defn,"(%s)",tbuf);
     }

     if (keyindexfp) { 		/* we have unique keys */
-	sprintf(tmpbuf, "%c:%8.8d", partchars[dbase], synptr->hereiam);
+	sprintf(tmpbuf, "%c:%8.8ld", partchars[dbase], synptr->hereiam);
 	synptr->key = GetKeyForOffset(tmpbuf);
     }

@@ -635,7 +630,7 @@ static void traceptrs(SynsetPtr synptr,

 	    if ((ptrtyp == PERTPTR || ptrtyp == PPLPTR) &&
 		synptr->pto[i] != 0) {
-		sprintf(tbuf, " (Sense %d)\n",
+		snprintf(tbuf, sizeof(tbuf), " (Sense %d)\n",
 			cursyn->wnsns[synptr->pto[i] - 1]);
 		printsynset(prefix, cursyn, tbuf, DEFOFF, synptr->pto[i],
 			    SKIP_ANTS, PRINT_MARKER);
@@ -656,7 +651,7 @@ static void traceptrs(SynsetPtr synptr,
 		    traceptrs(cursyn, HYPERPTR, getpos(cursyn->pos), 0);
 		}
 	    } else if (ptrtyp == ANTPTR && dbase != ADJ && synptr->pto[i] != 0) {
-		sprintf(tbuf, " (Sense %d)\n",
+		snprintf(tbuf, sizeof(tbuf), " (Sense %d)\n",
 			cursyn->wnsns[synptr->pto[i] - 1]);
 		printsynset(prefix, cursyn, tbuf, DEFOFF, synptr->pto[i],
 			    SKIP_ANTS, PRINT_MARKER);
@@ -817,7 +812,7 @@ static void tracenomins(SynsetPtr synptr

 	    cursyn = read_synset(synptr->ppos[i], synptr->ptroff[i], "");

-	    sprintf(tbuf, "#%d\n",
+	    snprintf(tbuf, sizeof(tbuf), "#%d\n",
 		    cursyn->wnsns[synptr->pto[i] - 1]);
 	    printsynset(prefix, cursyn, tbuf, DEFOFF, synptr->pto[i],
 			SKIP_ANTS, SKIP_MARKER);
@@ -989,12 +984,12 @@ void getexample(char *offset, char *wd)
     char sentbuf[512];

     if (vsentfilefp != NULL) {
-	if (line = bin_search(offset, vsentfilefp)) {
+	if ((line = bin_search(offset, vsentfilefp)) != NULL) {
 	    while(*line != ' ')
 		line++;

 	    printbuffer("          EX: ");
-	    sprintf(sentbuf, line, wd);
+	    snprintf(sentbuf, sizeof(sentbuf), line, wd);
 	    printbuffer(sentbuf);
 	}
     }
@@ -1011,7 +1006,7 @@ int findexample(SynsetPtr synptr)
     if (vidxfilefp != NULL) {
 	wdnum = synptr->whichword - 1;

-	sprintf(tbuf,"%s%%%-1.1d:%-2.2d:%-2.2d::",
+	snprintf(tbuf, sizeof(tbuf), "%s%%%-1.1d:%-2.2d:%-2.2d::",
 		synptr->words[wdnum],
 		getpos(synptr->pos),
 		synptr->fnum,
@@ -1124,7 +1119,7 @@ static void freq_word(IndexPtr index)
 	if (cnt >= 17 && cnt <= 32) familiar = 6;
 	if (cnt > 32 ) familiar = 7;

-	sprintf(tmpbuf,
+	snprintf(tmpbuf, sizeof(tmpbuf),
 		"\n%s used as %s is %s (polysemy count = %d)\n",
 		index->wd, a_an[getpos(index->pos)], freqcats[familiar], cnt);
 	printbuffer(tmpbuf);
@@ -1147,6 +1142,9 @@ void wngrep (char *word_passed, int pos)
    }
    rewind(inputfile);

+   if (strlen(word_passed) + 1 > sizeof(word))
+       return;
+
    strcpy (word, word_passed);
    ToLowerCase(word);		/* map to lower case for index file search */
    strsubst (word, ' ', '_');	/* replace spaces with underscores */
@@ -1169,7 +1167,7 @@ void wngrep (char *word_passed, int pos)
             ((line[loc + wordlen] == '-') || (line[loc + wordlen] == '_')))
          ) {
             strsubst (line, '_', ' ');
-            sprintf (tmpbuf, "%s\n", line);
+            snprintf (tmpbuf, sizeof(tmpbuf), "%s\n", line);
             printbuffer (tmpbuf);
             break;
          }
@@ -1683,9 +1681,8 @@ SynsetPtr traceptrs_ds(SynsetPtr synptr,
 		cursyn = read_synset(synptr->ppos[i],
 				      synptr->ptroff[i],
 				      "");
-		synptr->headword = malloc(strlen(cursyn->words[0]) + 1);
+		synptr->headword = strdup(cursyn->words[0]);
 		assert(synptr->headword);
-		strcpy(synptr->headword, cursyn->words[0]);
 		synptr->headsense = cursyn->lexid[0];
 		free_synset(cursyn);
 		break;
@@ -2013,7 +2010,7 @@ static int getsearchsense(SynsetPtr synp
     strsubst(strcpy(wdbuf, synptr->words[whichword - 1]), ' ', '_');
     strtolower(wdbuf);

-    if (idx = index_lookup(wdbuf, getpos(synptr->pos))) {
+    if ((idx = index_lookup(wdbuf, getpos(synptr->pos))) != NULL) {
 	for (i = 0; i < idx->off_cnt; i++)
 	    if (idx->offset[i] == synptr->hereiam) {
 		free_index(idx);
@@ -2037,7 +2034,7 @@ static void printsynset(char *head, Syns
        by flags */

     if (offsetflag)		/* print synset offset */
-	sprintf(tbuf + strlen(tbuf),"{%8.8d} ", synptr->hereiam);
+	sprintf(tbuf + strlen(tbuf),"{%8.8ld} ", synptr->hereiam);
     if (fileinfoflag) {		/* print lexicographer file information */
 	sprintf(tbuf + strlen(tbuf), "<%s> ", lexfiles[synptr->fnum]);
 	prlexid = 1;		/* print lexicographer id after word */
@@ -2072,7 +2069,7 @@ static void printantsynset(SynsetPtr syn
     tbuf[0] = '\0';

     if (offsetflag)
-	sprintf(tbuf,"{%8.8d} ", synptr->hereiam);
+	sprintf(tbuf,"{%8.8ld} ", synptr->hereiam);
     if (fileinfoflag) {
 	sprintf(tbuf + strlen(tbuf),"<%s> ", lexfiles[synptr->fnum]);
 	prlexid = 1;
--- a/lib/wnutil.c
+++ b/lib/wnutil.c
@@ -48,7 +48,7 @@ int wninit(void)
     char *env;

     if (!done) {
-	if (env = getenv("WNDBVERSION")) {
+	if ((env = getenv("WNDBVERSION")) != NULL) {
 	    wnrelease = strdup(env);	/* set release */
 	    assert(wnrelease);
 	}
@@ -70,7 +70,7 @@ int re_wninit(void)

     closefps();

-    if (env = getenv("WNDBVERSION")) {
+    if ((env = getenv("WNDBVERSION")) != NULL) {
 	wnrelease = strdup(env);	/* set release */
 	assert(wnrelease);
     }
@@ -149,25 +149,25 @@ static int do_init(void)
 	sprintf(searchdir, DEFAULTPATH);
 #else
     if ((env = getenv("WNSEARCHDIR")) != NULL)
-	strcpy(searchdir, env);
+	snprintf(searchdir, sizeof(searchdir), "%s", env);
     else if ((env = getenv("WNHOME")) != NULL)
-	sprintf(searchdir, "%s%s", env, DICTDIR);
+	snprintf(searchdir, sizeof(searchdir), "%s%s", env, DICTDIR);
     else
 	strcpy(searchdir, DEFAULTPATH);
 #endif

     for (i = 1; i < NUMPARTS + 1; i++) {
-	sprintf(tmpbuf, DATAFILE, searchdir, partnames[i]);
+	snprintf(tmpbuf, sizeof(tmpbuf), DATAFILE, searchdir, partnames[i]);
 	if((datafps[i] = fopen(tmpbuf, "r")) == NULL) {
-	    sprintf(msgbuf,
+	    snprintf(msgbuf, sizeof(msgbuf),
 		    "WordNet library error: Can't open datafile(%s)\n",
 		    tmpbuf);
 	    display_message(msgbuf);
 	    openerr = -1;
 	}
-	sprintf(tmpbuf, INDEXFILE, searchdir, partnames[i]);
+	snprintf(tmpbuf, sizeof(tmpbuf), INDEXFILE, searchdir, partnames[i]);
 	if((indexfps[i] = fopen(tmpbuf, "r")) == NULL) {
-	    sprintf(msgbuf,
+	    snprintf(msgbuf, sizeof(msgbuf),
 		    "WordNet library error: Can't open indexfile(%s)\n",
 		    tmpbuf);
 	    display_message(msgbuf);
@@ -178,35 +178,35 @@ static int do_init(void)
     /* This file isn't used by the library and doesn't have to
        be present.  No error is reported if the open fails. */

-    sprintf(tmpbuf, SENSEIDXFILE, searchdir);
+    snprintf(tmpbuf, sizeof(tmpbuf), SENSEIDXFILE, searchdir);
     sensefp = fopen(tmpbuf, "r");

     /* If this file isn't present, the runtime code will skip printint out
        the number of times each sense was tagged. */

-    sprintf(tmpbuf, CNTLISTFILE, searchdir);
+    snprintf(tmpbuf, sizeof(tmpbuf), CNTLISTFILE, searchdir);
     cntlistfp = fopen(tmpbuf, "r");

     /* This file doesn't have to be present.  No error is reported if the
        open fails. */

-    sprintf(tmpbuf, KEYIDXFILE, searchdir);
+    snprintf(tmpbuf, sizeof(tmpbuf), KEYIDXFILE, searchdir);
     keyindexfp = fopen(tmpbuf, "r");

-    sprintf(tmpbuf, REVKEYIDXFILE, searchdir);
+    snprintf(tmpbuf, sizeof(tmpbuf), REVKEYIDXFILE, searchdir);
     revkeyindexfp = fopen(tmpbuf, "r");

-    sprintf(tmpbuf, VRBSENTFILE, searchdir);
+    snprintf(tmpbuf, sizeof(tmpbuf), VRBSENTFILE, searchdir);
     if ((vsentfilefp = fopen(tmpbuf, "r")) == NULL) {
-	sprintf(msgbuf,
+	snprintf(msgbuf, sizeof(msgbuf),
 "WordNet library warning: Can't open verb example sentence file(%s)\n",
 		tmpbuf);
 	display_message(msgbuf);
     }

-    sprintf(tmpbuf, VRBIDXFILE, searchdir);
+    snprintf(tmpbuf, sizeof(tmpbuf), VRBIDXFILE, searchdir);
     if ((vidxfilefp = fopen(tmpbuf, "r")) == NULL) {
-	sprintf(msgbuf,
+	snprintf(msgbuf, sizeof(msgbuf),
 "WordNet library warning: Can't open verb example sentence index file(%s)\n",
 		tmpbuf);
 	display_message(msgbuf);
--- a/src/wn.c
+++ b/src/wn.c
@@ -131,7 +131,7 @@ static void printusage(), printlicense()
        printsearches(char *, int, unsigned long);
 static int error_message(char *);

-main(int argc,char *argv[])
+int main(int argc,char *argv[])
 {
     display_message = error_message;

@@ -228,14 +228,14 @@ static int do_search(char *searchword, i
 	printf("\n%s of %s %s\n%s",
 	       label, partnames[pos], searchword, outbuf);

-    if (morphword = morphstr(searchword, pos))
+    if ((morphword = morphstr(searchword, pos)) != NULL)
 	do {
 	    outbuf = findtheinfo(morphword, pos, search, whichsense);
 	    totsenses += wnresults.printcnt;
 	    if (strlen(outbuf) > 0)
 		printf("\n%s of %s %s\n%s",
 		       label, partnames[pos], morphword, outbuf);
-	} while (morphword = morphstr(NULL, pos));
+	} while ((morphword = morphstr(NULL, pos)) != NULL);

     return(totsenses);
 }


code:
This patch was created by oCert according to
 http://www.ocert.org/advisories/ocert-2008-014.html
Unfortunately the original patch contained a bug which was
later fixed by the issuer of the patch Rob Holland <rob@ocert.org>
This part was now separated in this file.

--- a/lib/search.c
+++ b/lib/search.c
@@ -1568,7 +1568,8 @@ char *findtheinfo(char *searchstr, int d
 			bufstart[0] = '\n';
 			bufstart++;
 		    }
-		    strncpy(bufstart, tmpbuf, strlen(tmpbuf));
+                   /* Avoid writing a trailing \0 after the string */
+                   memcpy(bufstart, tmpbuf, strlen(tmpbuf));
 		    bufstart = searchbuffer + strlen(searchbuffer);
 		}
 	    }


code:
From 8460e3230988ef2ec13ce6b69b687e941f6cdb32 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <jouni@codeaurora.org>
Date: Tue, 8 Dec 2020 23:52:50 +0200
Subject: [PATCH] P2P: Fix a corner case in peer addition based on PD Request

p2p_add_device() may remove the oldest entry if there is no room in the
peer table for a new peer. This would result in any pointer to that
removed entry becoming stale. A corner case with an invalid PD Request
frame could result in such a case ending up using (read+write) freed
memory. This could only by triggered when the peer table has reached its
maximum size and the PD Request frame is received from the P2P Device
Address of the oldest remaining entry and the frame has incorrect P2P
Device Address in the payload.

Fix this by fetching the dev pointer again after having called
p2p_add_device() so that the stale pointer cannot be used.

Fixes: 17bef1e97a50 ("P2P: Add peer entry based on Provision Discovery Request")
Signed-off-by: Jouni Malinen <jouni@codeaurora.org>
---
 src/p2p/p2p_pd.c | 12 +++++-------
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/src/p2p/p2p_pd.c b/src/p2p/p2p_pd.c
index 3994ec03f86b..05fd593494ef 100644
--- a/src/p2p/p2p_pd.c
+++ b/src/p2p/p2p_pd.c
@@ -595,14 +595,12 @@ void p2p_process_prov_disc_req(struct p2p_data *p2p, const u8 *sa,
 			goto out;
 		}

+		dev = p2p_get_device(p2p, sa);
 		if (!dev) {
-			dev = p2p_get_device(p2p, sa);
-			if (!dev) {
-				p2p_dbg(p2p,
-					"Provision Discovery device not found "
-					MACSTR, MAC2STR(sa));
-				goto out;
-			}
+			p2p_dbg(p2p,
+				"Provision Discovery device not found "
+				MACSTR, MAC2STR(sa));
+			goto out;
 		}
 	} else if (msg.wfd_subelems) {
 		wpabuf_free(dev->info.wfd_subelems);
--
2.25.1


code:
From a0541334a6394f8237a4393b7372693cd7e96f15 Mon Sep 17 00:00:00 2001
From: Jouni Malinen <j@w1.fi>
Date: Sat, 13 Mar 2021 18:19:31 +0200
Subject: ASN.1: Validate DigestAlgorithmIdentifier parameters

The supported hash algorithms do not use AlgorithmIdentifier parameters.
However, there are implementations that include NULL parameters in
addition to ones that omit the parameters. Previous implementation did
not check the parameters value at all which supported both these cases,
but did not reject any other unexpected information.

Use strict validation of digest algorithm parameters and reject any
unexpected value when validating a signature. This is needed to prevent
potential forging attacks.

Signed-off-by: Jouni Malinen <j@w1.fi>
---
 src/tls/pkcs1.c  | 21 +++++++++++++++++++++
 src/tls/x509v3.c | 20 ++++++++++++++++++++
 2 files changed, 41 insertions(+)

diff --git a/src/tls/pkcs1.c b/src/tls/pkcs1.c
index bbdb0d7..5761dfe 100644
--- a/src/tls/pkcs1.c
+++ b/src/tls/pkcs1.c
@@ -244,6 +244,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
 		os_free(decrypted);
 		return -1;
 	}
+	wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestInfo",
+		    hdr.payload, hdr.length);

 	pos = hdr.payload;
 	end = pos + hdr.length;
@@ -265,6 +267,8 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
 		os_free(decrypted);
 		return -1;
 	}
+	wpa_hexdump(MSG_MSGDUMP, "PKCS #1: DigestAlgorithmIdentifier",
+		    hdr.payload, hdr.length);
 	da_end = hdr.payload + hdr.length;

 	if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
@@ -273,6 +277,23 @@ int pkcs1_v15_sig_ver(struct crypto_public_key *pk,
 		os_free(decrypted);
 		return -1;
 	}
+	wpa_hexdump(MSG_MSGDUMP, "PKCS #1: Digest algorithm parameters",
+		    next, da_end - next);
+
+	/*
+	 * RFC 5754: The correct encoding for the SHA2 algorithms would be to
+	 * omit the parameters, but there are implementation that encode these
+	 * as a NULL element. Allow these two cases and reject anything else.
+	 */
+	if (da_end > next &&
+	    (asn1_get_next(next, da_end - next, &hdr) < 0 ||
+	     !asn1_is_null(&hdr) ||
+	     hdr.payload + hdr.length != da_end)) {
+		wpa_printf(MSG_DEBUG,
+			   "PKCS #1: Unexpected digest algorithm parameters");
+		os_free(decrypted);
+		return -1;
+	}

 	if (!asn1_oid_equal(&oid, hash_alg)) {
 		char txt[100], txt2[100];
diff --git a/src/tls/x509v3.c b/src/tls/x509v3.c
index a8944dd..df337ec 100644
--- a/src/tls/x509v3.c
+++ b/src/tls/x509v3.c
@@ -1964,6 +1964,7 @@ int x509_check_signature(struct x509_certificate *issuer,
 		os_free(data);
 		return -1;
 	}
+	wpa_hexdump(MSG_MSGDUMP, "X509: DigestInfo", hdr.payload, hdr.length);

 	pos = hdr.payload;
 	end = pos + hdr.length;
@@ -1985,6 +1986,8 @@ int x509_check_signature(struct x509_certificate *issuer,
 		os_free(data);
 		return -1;
 	}
+	wpa_hexdump(MSG_MSGDUMP, "X509: DigestAlgorithmIdentifier",
+		    hdr.payload, hdr.length);
 	da_end = hdr.payload + hdr.length;

 	if (asn1_get_oid(hdr.payload, hdr.length, &oid, &next)) {
@@ -1992,6 +1995,23 @@ int x509_check_signature(struct x509_certificate *issuer,
 		os_free(data);
 		return -1;
 	}
+	wpa_hexdump(MSG_MSGDUMP, "X509: Digest algorithm parameters",
+		    next, da_end - next);
+
+	/*
+	 * RFC 5754: The correct encoding for the SHA2 algorithms would be to
+	 * omit the parameters, but there are implementation that encode these
+	 * as a NULL element. Allow these two cases and reject anything else.
+	 */
+	if (da_end > next &&
+	    (asn1_get_next(next, da_end - next, &hdr) < 0 ||
+	     !asn1_is_null(&hdr) ||
+	     hdr.payload + hdr.length != da_end)) {
+		wpa_printf(MSG_DEBUG,
+			   "X509: Unexpected digest algorithm parameters");
+		os_free(data);
+		return -1;
+	}

 	if (x509_sha1_oid(&oid)) {
 		if (signature->oid.oid[6] != 5 /* sha-1WithRSAEncryption */) {
--
cgit v0.12


code:
Fix build flags for ARMv7.

Taken from Debian:
https://salsa.debian.org/multimedia-team/x265/-/blob/master/debian/patches/0001-Fix-arm-flags.patch

From: Sebastian Ramacher <sramacher@debian.org>
Date: Wed, 26 Apr 2017 22:05:06 +0200
Subject: Fix arm* flags

---
 source/CMakeLists.txt | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/source/CMakeLists.txt b/source/CMakeLists.txt
--- a/source/CMakeLists.txt
+++ b/source/CMakeLists.txt
@@ -77,7 +77,7 @@ elseif(ARMMATCH GREATER "-1")
         add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=1 -DHAVE_ARMV6=0)
     else()
         message(STATUS "Detected ARM target processor")
-        add_definitions(-DX265_ARCH_ARM=1 -DX265_ARCH_ARM64=0 -DHAVE_ARMV6=1)
+        add_definitions(-DX265_ARCH_ARM=1)
     endif()
 else()
     message(STATUS "CMAKE_SYSTEM_PROCESSOR value `${CMAKE_SYSTEM_PROCESSOR}` is unknown")
@@ -252,10 +252,7 @@ if(GCC)
         else()
             find_package(Neon)
             if(CPU_HAS_NEON)
-                set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=neon -marm -fPIC)
                 add_definitions(-DHAVE_NEON)
-            else()
-                set(ARM_ARGS -mcpu=native -mfloat-abi=hard -mfpu=vfp -marm)
             endif()
         endif()
     endif()


code:
Removes references to mibstore.h and miInitializeBackingStore, which
have been removed from xorg-server.  Zack Rusin <zackr@vmware.com>
wrote: "It was a noop for at least 5 years and it has been removed."
See: http://patches.openembedded.org/patch/46133/

--- xf86-video-ark-0.7.5/src/ark_driver.c.~1~	2012-07-17 00:51:36.000000000 -0400
+++ xf86-video-ark-0.7.5/src/ark_driver.c	2014-12-19 00:23:13.028931734 -0500
@@ -39,7 +39,6 @@
 #include "compiler.h"
 #include "mipointer.h"
 #include "micmap.h"
-#include "mibstore.h"
 #include "fb.h"
 #include "ark.h"

@@ -538,7 +537,6 @@

 	fbPictureInit (pScreen, 0, 0);

-	miInitializeBackingStore(pScreen);
 	xf86SetBackingStore(pScreen);

 	if (!pARK->NoAccel) {


code:
Fix test compilation with exa.h in configure when using glibc 2.20.
Inspired by a patch by Peter Hutterer <peter.hutterer@who-t.net>.
See <https://raw.githubusercontent.com/openembedded/oe-core/master/meta/recipes-graphics/xorg-driver/xf86-input-synaptics/always_include_xorg_server.h.patch>.

--- xf86-video-mach64-6.9.4/configure.~1~	2012-12-20 01:16:10.000000000 -0500
+++ xf86-video-mach64-6.9.4/configure	2014-12-19 02:48:18.040097554 -0500
@@ -18370,7 +18370,9 @@

         SAVE_CPPFLAGS="$CPPFLAGS"
         CPPFLAGS="$CPPFLAGS $XORG_CFLAGS"
-        ac_fn_c_check_header_mongrel "$LINENO" "exa.h" "ac_cv_header_exa_h" "$ac_includes_default"
+        ac_fn_c_check_header_mongrel "$LINENO" "exa.h" "ac_cv_header_exa_h" "$ac_includes_default
+#include <xorg-server.h>
+"
 if test "x$ac_cv_header_exa_h" = xyes; then :
   have_exa_h="yes"
 else


code:
Fix build against xorg-server >= 1.20.

Patch taken from upstream:
https://cgit.freedesktop.org/xorg/driver/xf86-video-savage/commit/?id=0ece556daa8a88771b669d8104396abd9166d2d0

diff --git a/src/savage_driver.c b/src/savage_driver.c
index 58a294d..3cda923 100644
--- a/src/savage_driver.c
+++ b/src/savage_driver.c
@@ -2034,8 +2034,6 @@ static Bool SavagePreInit(ScrnInfoPtr pScrn, int flags)
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED, "Detected current MCLK value of %1.3f MHz\n",
 	       mclk / 1000.0);

-    pScrn->maxHValue = 2048 << 3;	/* 11 bits of h_total 8-pixel units */
-    pScrn->maxVValue = 2048;		/* 11 bits of v_total */
     pScrn->virtualX = pScrn->display->virtualX;
     pScrn->virtualY = pScrn->display->virtualY;

@@ -3637,6 +3635,14 @@ static ModeStatus SavageValidMode(SCRN_ARG_TYPE arg, DisplayModePtr pMode,
        (pMode->VDisplay > psav->PanelY)))
 	    return MODE_PANEL;

+    /* 11 bits of h_total 8-pixel units */
+    if (pMode->HTotal > (2048 << 3))
+	return MODE_BAD_HVALUE;
+
+    /* 11 bits of v_total */
+    if (pMode->VTotal > 2048)
+	return MODE_BAD_VVALUE;
+
     if (psav->UseBIOS) {
 	refresh = SavageGetRefresh(pMode);
         return (SavageMatchBiosMode(pScrn,pMode->HDisplay,


code:
From eee8fd4c489a693344da0bba14cfa54c54610b89 Mon Sep 17 00:00:00 2001
From: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
Date: Thu, 9 Mar 2017 13:31:34 +0200
Subject: [PATCH] Fix build against xorg server 1.17 on certain architectures

Fixes at least arm64, likely also hppa, m68k, sh4.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@ubuntu.com>
---
 src/regsmi.h       | 18 ++++++++++++++++++
 src/smi.h          |  2 ++
 src/smi_driver.c   | 19 +++++++++----------
 src/smilynx_crtc.c |  6 +++---
 src/smilynx_hw.c   |  5 ++---
 5 files changed, 34 insertions(+), 16 deletions(-)

diff --git a/src/regsmi.h b/src/regsmi.h
index 5dd0320..69205ba 100644
--- a/src/regsmi.h
+++ b/src/regsmi.h
@@ -64,8 +64,13 @@ VGAIN8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index)
 	MMIO_OUT8(pSmi->IOBase, indexPort, index);
 	return(MMIO_IN8(pSmi->IOBase, dataPort));
     } else {
+#ifdef XSERVER_LIBPCIACCESS
+	pci_io_write8(pSmi->io, indexPort, index);
+	return pci_io_read8(pSmi->io, dataPort);
+#else
 	outb(pSmi->PIOBase + indexPort, index);
 	return(inb(pSmi->PIOBase + dataPort));
+#endif
     }
 }

@@ -76,8 +81,13 @@ VGAOUT8_INDEX(SMIPtr pSmi, int indexPort, int dataPort, CARD8 index, CARD8 data)
 	MMIO_OUT8(pSmi->IOBase, indexPort, index);
 	MMIO_OUT8(pSmi->IOBase, dataPort, data);
     } else {
+#ifdef XSERVER_LIBPCIACCESS
+	pci_io_write8(pSmi->io, indexPort, index);
+	pci_io_write8(pSmi->io, dataPort, data);
+#else
 	outb(pSmi->PIOBase + indexPort, index);
 	outb(pSmi->PIOBase + dataPort, data);
+#endif
     }
 }

@@ -87,7 +97,11 @@ VGAIN8(SMIPtr pSmi, int port)
     if (pSmi->IOBase) {
 	return(MMIO_IN8(pSmi->IOBase, port));
     } else {
+#ifdef XSERVER_LIBPCIACCESS
+	return pci_io_read8(pSmi->io, port);
+#else
 	return(inb(pSmi->PIOBase + port));
+#endif
     }
 }

@@ -97,7 +111,11 @@ VGAOUT8(SMIPtr pSmi, int port, CARD8 data)
     if (pSmi->IOBase) {
 	MMIO_OUT8(pSmi->IOBase, port, data);
     } else {
+#ifdef XSERVER_LIBPCIACCESS
+	pci_io_write8(pSmi->io, port, data);
+#else
 	outb(pSmi->PIOBase + port, data);
+#endif
     }
 }

diff --git a/src/smi.h b/src/smi.h
index 2742c8d..1f20a2d 100644
--- a/src/smi.h
+++ b/src/smi.h
@@ -171,6 +171,8 @@ typedef struct
     pciVideoPtr		PciInfo;	/* PCI info vars */
 #ifndef XSERVER_LIBPCIACCESS
     PCITAG		PciTag;
+#else
+    struct pci_io_handle *io;
 #endif
     int			Chipset;	/* Chip info, set using PCI
 					   above */
diff --git a/src/smi_driver.c b/src/smi_driver.c
index 8949cae..6bdf64d 100644
--- a/src/smi_driver.c
+++ b/src/smi_driver.c
@@ -446,6 +446,9 @@ SMI_PreInit(ScrnInfoPtr pScrn, int flags)
 	pSmi->PIOBase = hwp->PIOOffset;
 #else
 	pSmi->PIOBase = 0;
+#ifdef XSERVER_LIBPCIACCESS
+	pSmi->io = hwp->io;
+#endif
 #endif

 	xf86ErrorFVerb(VERBLEV, "\tSMI_PreInit vgaCRIndex=%x, vgaIOBase=%x, "
@@ -2022,16 +2025,14 @@ SMI_EnableMmio(ScrnInfoPtr pScrn)
 	vgaHWSetStdFuncs(hwp);

 	/* Enable linear mode */
-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
-	tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18);
 	pSmi->SR18Value = tmp;					/* PDR#521 */
-	outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x11);
+	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp | 0x11);

 	/* Enable 2D/3D Engine and Video Processor */
-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
-	tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
+	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
 	pSmi->SR21Value = tmp;					/* PDR#521 */
-	outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp & ~0x03);
+	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, tmp & ~0x03);
     }

     LEAVE();
@@ -2050,12 +2051,10 @@ SMI_DisableMmio(ScrnInfoPtr pScrn)
 	vgaHWSetStdFuncs(hwp);

 	/* Disable 2D/3D Engine and Video Processor */
-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x21);
-	outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR21Value);	/* PDR#521 */
+	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21, pSmi->SR21Value);	/* PDR#521 */

 	/* Disable linear mode */
-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
-	outb(pSmi->PIOBase + VGA_SEQ_DATA, pSmi->SR18Value);	/* PDR#521 */
+	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, pSmi->SR18Value);	/* PDR#521 */
     }

     LEAVE();
diff --git a/src/smilynx_crtc.c b/src/smilynx_crtc.c
index fb7183c..f4d8b4e 100644
--- a/src/smilynx_crtc.c
+++ b/src/smilynx_crtc.c
@@ -619,9 +619,9 @@ SMILynx_CrtcModeSet_bios(xf86CrtcPtr crtc,
     xf86ExecX86int10(pSmi->pInt10);

     /* Enable linear mode. */
-    outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
-    tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
-    outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x01);
+    VGAOUT8(pSmi, VGA_SEQ_INDEX, 0x18);
+    tmp = VGAIN8(pSmi, VGA_SEQ_DATA);
+    VGAOUT8(pSmi, VGA_SEQ_DATA, tmp | 0x01);

     /* Enable DPR/VPR registers. */
     tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
diff --git a/src/smilynx_hw.c b/src/smilynx_hw.c
index b2ee8a5..40aa5a4 100644
--- a/src/smilynx_hw.c
+++ b/src/smilynx_hw.c
@@ -365,9 +365,8 @@ SMILynx_WriteMode(ScrnInfoPtr pScrn, vgaRegPtr vgaSavePtr, SMIRegPtr restore)
 	xf86ExecX86int10(pSmi->pInt10);

 	/* Enable linear mode. */
-	outb(pSmi->PIOBase + VGA_SEQ_INDEX, 0x18);
-	tmp = inb(pSmi->PIOBase + VGA_SEQ_DATA);
-	outb(pSmi->PIOBase + VGA_SEQ_DATA, tmp | 0x01);
+	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18);
+	VGAOUT8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x18, tmp | 0x01);

 	/* Enable DPR/VPR registers. */
 	tmp = VGAIN8_INDEX(pSmi, VGA_SEQ_INDEX, VGA_SEQ_DATA, 0x21);
--
2.7.4


code:
Removes references to mibstore.h and miInitializeBackingStore, which
have been removed from xorg-server.  Zack Rusin <zackr@vmware.com>
wrote: "It was a noop for at least 5 years and it has been removed."
See: http://patches.openembedded.org/patch/46133/

--- xf86-video-tga-1.2.2/src/tga_accel.c.~1~	2012-07-15 23:54:04.000000000 -0400
+++ xf86-video-tga-1.2.2/src/tga_accel.c	2014-12-19 01:40:27.535913013 -0500
@@ -37,7 +37,6 @@
 #include "xf86cmap.h"
 #include "mipointer.h"

-#include "mibstore.h"
 #include "miline.h"

 #include "tga_regs.h"
--- xf86-video-tga-1.2.2/src/tga_driver.c.~1~	2012-07-15 23:54:28.000000000 -0400
+++ xf86-video-tga-1.2.2/src/tga_driver.c	2014-12-19 01:40:48.756018238 -0500
@@ -46,8 +46,6 @@

 /* software cursor */
 #include "mipointer.h"
-/* backing store */
-#include "mibstore.h"

 /*  #include "mibank.h" */
 /* colormap manipulation */
@@ -1451,7 +1449,6 @@

     fbPictureInit (pScreen, 0, 0);

-    miInitializeBackingStore(pScreen);
     xf86SetBackingStore(pScreen);
     xf86SetSilkenMouse(pScreen);


code:
From: Tobias Geerinckx-Rice <me@tobias.gr>
Date: Mon, 20 May 2019 04:52:33 +0200
Subject: [PATCH] gnu: xf86-video-voodoo: Don't use PCITAG.

Copied verbatim from upstream repository[0].

[0]: https://cgit.freedesktop.org/xorg/driver/-xf86-video-voodoo/patch/?id=9172ae566a0e85313fc80ab62b4455393eefe593

From 9172ae566a0e85313fc80ab62b4455393eefe593 Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 22 Sep 2014 10:56:02 +1000
Subject: don't use PCITAG in struct anymore

---
 src/voodoo.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/voodoo.h b/src/voodoo.h
index bfed497..c3eb64e 100644
--- a/src/voodoo.h
+++ b/src/voodoo.h
@@ -23,7 +23,9 @@ typedef struct {

   Bool		      Voodoo2;		/* Set if Voodoo2 */
   pciVideoPtr	      PciInfo;		/* PCI data */
+#ifndef XSERVER_LIBPCIACCESS
   PCITAG	      PciTag;
+#endif
   CARD32	      PhysBase;

   CARD32	      Width;		/* Current width */
--
cgit v1.0