aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch')
-rw-r--r--gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch b/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch
new file mode 100644
index 0000000000..4133be7fc9
--- /dev/null
+++ b/gnu/packages/patches/libssh2-fix-build-failure-with-gcrypt.patch
@@ -0,0 +1,33 @@
+This fixes a regression introduced in 1.8.0 where libssh2 fails to build
+with the gcrypt backend.
+
+Upstream bug URL:
+
+https://github.com/libssh2/libssh2/issues/150
+
+Patch copied from upstream source repository:
+
+https://github.com/libssh2/libssh2/commit/ced924b78a40126606797ef57a74066eb3b4b83f
+
+From ced924b78a40126606797ef57a74066eb3b4b83f Mon Sep 17 00:00:00 2001
+From: Sergei Trofimovich <siarheit@google.com>
+Date: Mon, 31 Oct 2016 09:04:33 +0000
+Subject: [PATCH] acinclude.m4: fix ./configure --with-libgcrypt
+
+diff --git a/acinclude.m4 b/acinclude.m4
+index 734ef07..c78260c 100644
+--- a/acinclude.m4
++++ b/acinclude.m4
+@@ -412,9 +412,9 @@ AC_DEFUN([LIBSSH2_CHECKFOR_GCRYPT], [
+
+ old_LDFLAGS=$LDFLAGS
+ old_CFLAGS=$CFLAGS
+- if test -n "$use_libgcrypt" && test "$use_libgcrypt" != "no"; then
+- LDFLAGS="$LDFLAGS -L$use_libgcrypt/lib"
+- CFLAGS="$CFLAGS -I$use_libgcrypt/include"
++ if test -n "$with_libgcrypt_prefix" && test "$use_libgcrypt" != "no"; then
++ LDFLAGS="$LDFLAGS -L$with_libgcrypt_prefix/lib"
++ CFLAGS="$CFLAGS -I$with_libgcrypt_prefix/include"
+ fi
+ AC_LIB_HAVE_LINKFLAGS([gcrypt], [], [
+ #include <gcrypt.h>
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
+
diff --git a/gnu/packages/spice.scm b/gnu/packages/spice.scm
index 363a5e8fc5..838db4b35d 100644
--- a/gnu/packages/spice.scm
+++ b/gnu/packages/spice.scm
@@ -102,6 +102,7 @@
(uri (string-append
"https://www.freedesktop.org/software/virgl/"
"virglrenderer-" version ".tar.bz2"))
+ (patches (search-patches "virglrenderer-CVE-2017-6386.patch"))
(sha256
(base32
"06kf0q4l52gzx5p63l8850hff8pmhp7xv1hk8zgx2apbw18y6jd5"))))