code:
Copied from Fedora.

http://pkgs.fedoraproject.org/cgit/unzip.git/plain/unzip-6.0-format-secure.patch?id=d18f821e

diff --git a/extract.c b/extract.c
index eeb2f57..a0a4929 100644
--- a/extract.c
+++ b/extract.c
@@ -472,8 +472,8 @@ int extract_or_test_files(__G)    /* return PK-type error code */
                      */
                     Info(slide, 0x401, ((char *)slide,
                       LoadFarString(CentSigMsg), j + blknum*DIR_BLKSIZ + 1));
-                    Info(slide, 0x401, ((char *)slide,
-                      LoadFarString(ReportMsg)));
+                    Info(slide, 0x401,
+                         ((char *)slide,"%s", LoadFarString(ReportMsg)));
                     error_in_archive = PK_BADERR;
                 }
                 reached_end = TRUE;     /* ...so no more left to do */
@@ -752,8 +752,8 @@ int extract_or_test_files(__G)    /* return PK-type error code */

 #ifndef SFX
     if (no_endsig_found) {                      /* just to make sure */
-        Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
-        Info(slide, 0x401, ((char *)slide, LoadFarString(ReportMsg)));
+        Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(EndSigMsg)));
+        Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(ReportMsg)));
         if (!error_in_archive)       /* don't overwrite stronger error */
             error_in_archive = PK_WARN;
     }
diff --git a/list.c b/list.c
index 15e0011..f7359c3 100644
--- a/list.c
+++ b/list.c
@@ -181,7 +181,7 @@ int list_files(__G)    /* return PK-type error code */
                 Info(slide, 0x401,
                      ((char *)slide, LoadFarString(CentSigMsg), j));
                 Info(slide, 0x401,
-                     ((char *)slide, LoadFarString(ReportMsg)));
+                     ((char *)slide,"%s", LoadFarString(ReportMsg)));
                 return PK_BADERR;   /* sig not found */
             }
         }
@@ -507,7 +507,8 @@ int list_files(__G)    /* return PK-type error code */
             && (!G.ecrec.is_zip64_archive)
             && (memcmp(G.sig, end_central_sig, 4) != 0)
            ) {          /* just to make sure again */
-            Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
+            Info(slide, 0x401,
+                 ((char *)slide,"%s", LoadFarString(EndSigMsg)));
             error_in_archive = PK_WARN;   /* didn't find sig */
         }

@@ -591,7 +592,7 @@ int get_time_stamp(__G__ last_modtime, nmember)  /* return PK-type error code */
                 Info(slide, 0x401,
                      ((char *)slide, LoadFarString(CentSigMsg), j));
                 Info(slide, 0x401,
-                     ((char *)slide, LoadFarString(ReportMsg)));
+                     ((char *)slide,"%s", LoadFarString(ReportMsg)));
                 return PK_BADERR;   /* sig not found */
             }
         }
@@ -674,7 +675,7 @@ int get_time_stamp(__G__ last_modtime, nmember)  /* return PK-type error code */
   ---------------------------------------------------------------------------*/

     if (memcmp(G.sig, end_central_sig, 4)) {    /* just to make sure again */
-        Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
+        Info(slide, 0x401, ((char *)slide,"%s", LoadFarString(EndSigMsg)));
         error_in_archive = PK_WARN;
     }
     if (*nmember == 0L && error_in_archive <= PK_WARN)
diff --git a/zipinfo.c b/zipinfo.c
index 6e22cc8..ac5c61b 100644
--- a/zipinfo.c
+++ b/zipinfo.c
@@ -771,7 +771,7 @@ int zipinfo(__G)   /* return PK-type error code */
                 Info(slide, 0x401,
                      ((char *)slide, LoadFarString(CentSigMsg), j));
                 Info(slide, 0x401,
-                     ((char *)slide, LoadFarString(ReportMsg)));
+                     ((char *)slide,"%s", LoadFarString(ReportMsg)));
                 error_in_archive = PK_BADERR;   /* sig not found */
                 break;
             }
@@ -960,7 +960,8 @@ int zipinfo(__G)   /* return PK-type error code */
             && (!G.ecrec.is_zip64_archive)
             && (memcmp(G.sig, end_central_sig, 4) != 0)
            ) {          /* just to make sure again */
-            Info(slide, 0x401, ((char *)slide, LoadFarString(EndSigMsg)));
+            Info(slide, 0x401,
+                 ((char *)slide,"%s", LoadFarString(EndSigMsg)));
             error_in_archive = PK_WARN;   /* didn't find sig */
         }


code:
Copied from Debian.

From: Andreas Schwab <schwab@linux-m68k.org>
Subject: Initialize the symlink flag
Bug-Debian: http://bugs.debian.org/717029
X-Debian-version: 6.0-10

--- a/process.c
+++ b/process.c
@@ -1758,6 +1758,12 @@
         = (G.crec.general_purpose_bit_flag & (1 << 11)) == (1 << 11);
 #endif

+#ifdef SYMLINKS
+    /* Initialize the symlink flag, may be set by the platform-specific
+       mapattr function.  */
+    G.pInfo->symlink = 0;
+#endif
+
     return PK_COOL;

 } /* end function process_cdir_file_hdr() */

license: mit


code:
Copied from Fedora.

http://pkgs.fedoraproject.org/cgit/unzip.git/plain/unzip-6.0-overflow-long-fsize.patch?id=d18f821e

diff --git a/list.c b/list.c
index f7359c3..4c3d703 100644
--- a/list.c
+++ b/list.c
@@ -97,7 +97,7 @@ int list_files(__G)    /* return PK-type error code */
 {
     int do_this_file=FALSE, cfactor, error, error_in_archive=PK_COOL;
 #ifndef WINDLL
-    char sgn, cfactorstr[10];
+    char sgn, cfactorstr[13];
     int longhdr=(uO.vflag>1);
 #endif
     int date_format;
@@ -339,7 +339,19 @@ int list_files(__G)    /* return PK-type error code */
                 G.crec.compression_method == ENHDEFLATED) {
                 methbuf[5] = dtype[(G.crec.general_purpose_bit_flag>>1) & 3];
             } else if (methnum >= NUM_METHODS) {
-                sprintf(&methbuf[4], "%03u", G.crec.compression_method);
+                /* 2013-02-26 SMS.
+                 * http://sourceforge.net/tracker/?func=detail
+                 *  &aid=2861648&group_id=118012&atid=679786
+                 * Unexpectedly large compression methods overflow
+                 * &methbuf[].  Use the old, three-digit decimal format
+                 * for values which fit.  Otherwise, sacrifice the
+                 * colon, and use four-digit hexadecimal.
+                 */
+                if (G.crec.compression_method <= 999) {
+                    sprintf( &methbuf[ 4], "%03u", G.crec.compression_method);
+                } else {
+                    sprintf( &methbuf[ 3], "%04X", G.crec.compression_method);
+                }
             }

 #if 0       /* GRR/Euro:  add this? */


code:
Extracted from a patch in Fedora.

http://pkgs.fedoraproject.org/cgit/unzip.git/tree/unzip-6.0-heap-overflow-infloop.patch?id=d18f821e

From bd150334fb4084f5555a6be26b015a0671cb5b74 Mon Sep 17 00:00:00 2001
From: Kamil Dudka <kdudka@redhat.com>
Date: Tue, 22 Sep 2015 18:52:23 +0200
Subject: [PATCH 3/3] extract: prevent unsigned overflow on invalid input

Suggested-by: Stefan Cornelius
---
 extract.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/extract.c b/extract.c
index 29db027..b9ae667 100644
--- a/extract.c
+++ b/extract.c
@@ -1257,8 +1257,17 @@ static int extract_or_test_entrylist(__G__ numchunk,
         if (G.lrec.compression_method == STORED) {
             zusz_t csiz_decrypted = G.lrec.csize;

-            if (G.pInfo->encrypted)
+            if (G.pInfo->encrypted) {
+                if (csiz_decrypted <= 12) {
+                    /* handle the error now to prevent unsigned overflow */
+                    Info(slide, 0x401, ((char *)slide,
+                      LoadFarStringSmall(ErrUnzipNoFile),
+                      LoadFarString(InvalidComprData),
+                      LoadFarStringSmall2(Inflate)));
+                    return PK_ERR;
+                }
                 csiz_decrypted -= 12;
+            }
             if (G.lrec.ucsize != csiz_decrypted) {
                 Info(slide, 0x401, ((char *)slide,
                   LoadFarStringSmall2(WrnStorUCSizCSizDiff),
--
2.5.2


code:
Copied from Debian.

From: Jérémy Bobbio <lunar@debian.org>
Subject: Remove build date
Bug-Debian: http://bugs.debian.org/782851
 In order to make unzip build reproducibly, we remove the
 (already optional) build date from the binary.

--- a/unix/unix.c
+++ b/unix/unix.c
@@ -1705,7 +1705,7 @@
 #endif /* Sun */
 #endif /* SGI */

-#ifdef __DATE__
+#if 0
       " on ", __DATE__
 #else
       "", ""


code:
Remove explicit set of UPOWER_CONF_FILE_NAME in up-self-test.c;
instead the harness should set it.  In Guix we set it explicitly; the
right thing is to use AM_TEST_ENVIRONMENT and regenerate the
makefiles, but we can't regenerate because current autotools carp on
some things, so we patch the Makefile.in instead.

Also fix to not try to create /var/lib/upower if /var isn't writable.

Patch by Andy Wingo <wingo@igalia.com>
Reduced to upower 0.99.10 by Tobias Geerinckx-Rice <me@tobias.gr>

--- upower-0.99.2.orig/src/Makefile.in	2014-12-18 10:32:01.000000000 +0100
+++ upower-0.99.2/src/Makefile.in	2015-04-04 19:49:28.020843678 +0200
@@ -1789,7 +1790,7 @@
 @HAVE_SYSTEMDSYSTEMUNITDIR_TRUE@	@sed -e "s|\@libexecdir\@|$(libexecdir)|" $< > $@

 install-data-hook:
-	if test -w $(DESTDIR)$(prefix)/; then \
+	if test -w $(DESTDIR)$(localstatedir)/; then \
 		mkdir -p $(DESTDIR)$(historydir); \
 	fi


code:
This patch allows to compile the 'ustr' package with gcc-5.

Patch copied from Debian:

https://anonscm.debian.org/cgit/users/zito-guest/pkg-ustr.git/commit/?id=fb2528fef188b4de51a27c4f688042c36d2d7a18

From: Václav Ovsík <vaclav.ovsik@gmail.com>
Subject: [PATCH] fixes/gnu-inline

This patch adds `__attribute__ ((gnu_inline))' into prototype macros
before `inline' to force GNU89 behaviour of inline functions
in C99 mode.
See http://www.gnu.org/software/gcc/gcc-5/porting_to.html

Signed-off-by: Václav Ovsík <vaclav.ovsik@gmail.com>

---
 ustr-b-dbg-code.c       | 8 ++++----
 ustr-b-opt-code.c       | 8 ++++----
 ustr-cmp-dbg-code.c     | 8 ++++----
 ustr-cmp-opt-code.c     | 8 ++++----
 ustr-compiler.h         | 4 ++--
 ustr-fmt-dbg-code.c     | 8 ++++----
 ustr-fmt-opt-code.c     | 8 ++++----
 ustr-ins-dbg-code.c     | 8 ++++----
 ustr-ins-opt-code.c     | 8 ++++----
 ustr-io-dbg-code.c      | 8 ++++----
 ustr-io-opt-code.c      | 8 ++++----
 ustr-main-dbg-code.c    | 2 +-
 ustr-main-opt-code.c    | 2 +-
 ustr-parse-dbg-code.c   | 8 ++++----
 ustr-parse-opt-code.c   | 8 ++++----
 ustr-pool-dbg-code.c    | 8 ++++----
 ustr-pool-opt-code.c    | 8 ++++----
 ustr-replace-dbg-code.c | 8 ++++----
 ustr-replace-opt-code.c | 8 ++++----
 ustr-sc-dbg-code.c      | 8 ++++----
 ustr-sc-opt-code.c      | 8 ++++----
 ustr-set-dbg-code.c     | 8 ++++----
 ustr-set-opt-code.c     | 8 ++++----
 ustr-split-dbg-code.c   | 8 ++++----
 ustr-split-opt-code.c   | 8 ++++----
 ustr-spn-dbg-code.c     | 8 ++++----
 ustr-spn-opt-code.c     | 8 ++++----
 ustr-srch-dbg-code.c    | 8 ++++----
 ustr-srch-opt-code.c    | 8 ++++----
 ustr-sub-dbg-code.c     | 8 ++++----
 ustr-sub-opt-code.c     | 8 ++++----
 ustr-utf8-dbg-code.c    | 8 ++++----
 ustr-utf8-opt-code.c    | 8 ++++----
 33 files changed, 124 insertions(+), 124 deletions(-)

diff --git a/ustr-b-dbg-code.c b/ustr-b-dbg-code.c
index 4a7fdac..60e383e 100644
--- a/ustr-b-dbg-code.c
+++ b/ustr-b-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-b.h"
diff --git a/ustr-b-opt-code.c b/ustr-b-opt-code.c
index 45e9e87..4011898 100644
--- a/ustr-b-opt-code.c
+++ b/ustr-b-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-b.h"
diff --git a/ustr-cmp-dbg-code.c b/ustr-cmp-dbg-code.c
index 7b8af33..4c3adc2 100644
--- a/ustr-cmp-dbg-code.c
+++ b/ustr-cmp-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-cmp.h"
diff --git a/ustr-cmp-opt-code.c b/ustr-cmp-opt-code.c
index 2076d1c..ff5d02c 100644
--- a/ustr-cmp-opt-code.c
+++ b/ustr-cmp-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-cmp.h"
diff --git a/ustr-compiler.h b/ustr-compiler.h
index 9e71276..38ae026 100644
--- a/ustr-compiler.h
+++ b/ustr-compiler.h
@@ -92,7 +92,7 @@
 #endif

 #if USTR_CONF_COMPILE_USE_INLINE
-#define USTR__INLINE inline
+#define USTR__INLINE  __attribute__ ((gnu_inline)) inline
 #else
 #define USTR__INLINE /* no inline */
 #endif
@@ -123,7 +123,7 @@
 # if USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #  define USTR_CONF_II_PROTO static USTR__INLINE
 # else
-#  define USTR_CONF_II_PROTO extern inline
+#  define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 # endif
 #endif

diff --git a/ustr-fmt-dbg-code.c b/ustr-fmt-dbg-code.c
index 4249bb1..1f147a0 100644
--- a/ustr-fmt-dbg-code.c
+++ b/ustr-fmt-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-fmt.h"
diff --git a/ustr-fmt-opt-code.c b/ustr-fmt-opt-code.c
index c73e375..989b29f 100644
--- a/ustr-fmt-opt-code.c
+++ b/ustr-fmt-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-fmt.h"
diff --git a/ustr-ins-dbg-code.c b/ustr-ins-dbg-code.c
index 39f9bba..4c6d5ea 100644
--- a/ustr-ins-dbg-code.c
+++ b/ustr-ins-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-fmt.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
@@ -17,5 +17,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-ins.h"
diff --git a/ustr-ins-opt-code.c b/ustr-ins-opt-code.c
index 1aca827..859b44d 100644
--- a/ustr-ins-opt-code.c
+++ b/ustr-ins-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-fmt.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
@@ -17,5 +17,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-ins.h"
diff --git a/ustr-io-dbg-code.c b/ustr-io-dbg-code.c
index c361c93..d42e43f 100644
--- a/ustr-io-dbg-code.c
+++ b/ustr-io-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-io.h"
diff --git a/ustr-io-opt-code.c b/ustr-io-opt-code.c
index b1b4525..ae8de87 100644
--- a/ustr-io-opt-code.c
+++ b/ustr-io-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-io.h"
diff --git a/ustr-main-dbg-code.c b/ustr-main-dbg-code.c
index 4b821ce..abaa53a 100644
--- a/ustr-main-dbg-code.c
+++ b/ustr-main-dbg-code.c
@@ -7,5 +7,5 @@
 #define USTR_CONF_E_PROTO  extern
 #define USTR_CONF_I_PROTO
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
diff --git a/ustr-main-opt-code.c b/ustr-main-opt-code.c
index 233fb60..7ef6e98 100644
--- a/ustr-main-opt-code.c
+++ b/ustr-main-opt-code.c
@@ -7,5 +7,5 @@
 #define USTR_CONF_E_PROTO  extern
 #define USTR_CONF_I_PROTO
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
diff --git a/ustr-parse-dbg-code.c b/ustr-parse-dbg-code.c
index c9653af..6e1707d 100644
--- a/ustr-parse-dbg-code.c
+++ b/ustr-parse-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-parse.h"
diff --git a/ustr-parse-opt-code.c b/ustr-parse-opt-code.c
index 0c8df4d..fc96db2 100644
--- a/ustr-parse-opt-code.c
+++ b/ustr-parse-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-parse.h"
diff --git a/ustr-pool-dbg-code.c b/ustr-pool-dbg-code.c
index adf7519..957f9ca 100644
--- a/ustr-pool-dbg-code.c
+++ b/ustr-pool-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-pool.h"
diff --git a/ustr-pool-opt-code.c b/ustr-pool-opt-code.c
index 2b0367c..c1b2413 100644
--- a/ustr-pool-opt-code.c
+++ b/ustr-pool-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-pool.h"
diff --git a/ustr-replace-dbg-code.c b/ustr-replace-dbg-code.c
index fe02187..90531ac 100644
--- a/ustr-replace-dbg-code.c
+++ b/ustr-replace-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-set.h"
 #include "ustr-srch.h"
@@ -19,5 +19,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-replace.h"
diff --git a/ustr-replace-opt-code.c b/ustr-replace-opt-code.c
index e76b3bb..6232753 100644
--- a/ustr-replace-opt-code.c
+++ b/ustr-replace-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-set.h"
 #include "ustr-srch.h"
@@ -19,5 +19,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-replace.h"
diff --git a/ustr-sc-dbg-code.c b/ustr-sc-dbg-code.c
index 0011c63..d7ce317 100644
--- a/ustr-sc-dbg-code.c
+++ b/ustr-sc-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-spn.h"
 #include "ustr-utf8.h"
@@ -18,5 +18,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-sc.h"
diff --git a/ustr-sc-opt-code.c b/ustr-sc-opt-code.c
index 7cb81ba..4a97ed9 100644
--- a/ustr-sc-opt-code.c
+++ b/ustr-sc-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-spn.h"
 #include "ustr-utf8.h"
@@ -18,5 +18,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-sc.h"
diff --git a/ustr-set-dbg-code.c b/ustr-set-dbg-code.c
index 023875a..cf77071 100644
--- a/ustr-set-dbg-code.c
+++ b/ustr-set-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-fmt.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
@@ -17,5 +17,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-set.h"
diff --git a/ustr-set-opt-code.c b/ustr-set-opt-code.c
index e726888..34dcaf6 100644
--- a/ustr-set-opt-code.c
+++ b/ustr-set-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-fmt.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
@@ -17,5 +17,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-set.h"
diff --git a/ustr-split-dbg-code.c b/ustr-split-dbg-code.c
index 03e5ca5..e40d2a5 100644
--- a/ustr-split-dbg-code.c
+++ b/ustr-split-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-set.h"
 #include "ustr-spn.h"
@@ -19,5 +19,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-split.h"
diff --git a/ustr-split-opt-code.c b/ustr-split-opt-code.c
index d64e300..74f4b1c 100644
--- a/ustr-split-opt-code.c
+++ b/ustr-split-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-set.h"
 #include "ustr-spn.h"
@@ -19,5 +19,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-split.h"
diff --git a/ustr-spn-dbg-code.c b/ustr-spn-dbg-code.c
index ff97432..b0b09d4 100644
--- a/ustr-spn-dbg-code.c
+++ b/ustr-spn-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-srch.h"
 #include "ustr-utf8.h"
@@ -18,5 +18,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-spn.h"
diff --git a/ustr-spn-opt-code.c b/ustr-spn-opt-code.c
index 3ff0a07..92c5ccc 100644
--- a/ustr-spn-opt-code.c
+++ b/ustr-spn-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-srch.h"
 #include "ustr-utf8.h"
@@ -18,5 +18,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-spn.h"
diff --git a/ustr-srch-dbg-code.c b/ustr-srch-dbg-code.c
index 40e4dbf..0f4da21 100644
--- a/ustr-srch-dbg-code.c
+++ b/ustr-srch-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-cmp-internal.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
@@ -17,6 +17,6 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-srch.h"

diff --git a/ustr-srch-opt-code.c b/ustr-srch-opt-code.c
index 635464d..8dde13d 100644
--- a/ustr-srch-opt-code.c
+++ b/ustr-srch-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-cmp-internal.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
@@ -17,6 +17,6 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-srch.h"

diff --git a/ustr-sub-dbg-code.c b/ustr-sub-dbg-code.c
index f994716..b1712e6 100644
--- a/ustr-sub-dbg-code.c
+++ b/ustr-sub-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-fmt.h"
 #include "ustr-ins.h"
@@ -19,5 +19,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-sub.h"
diff --git a/ustr-sub-opt-code.c b/ustr-sub-opt-code.c
index 8cdb4eb..91780c7 100644
--- a/ustr-sub-opt-code.c
+++ b/ustr-sub-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #include "ustr-fmt.h"
 #include "ustr-ins.h"
@@ -19,5 +19,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-sub.h"
diff --git a/ustr-utf8-dbg-code.c b/ustr-utf8-dbg-code.c
index 2666fc2..30786e9 100644
--- a/ustr-utf8-dbg-code.c
+++ b/ustr-utf8-dbg-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf-debug.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-utf8.h"
diff --git a/ustr-utf8-opt-code.c b/ustr-utf8-opt-code.c
index 91fa754..abdf4c0 100644
--- a/ustr-utf8-opt-code.c
+++ b/ustr-utf8-opt-code.c
@@ -3,11 +3,11 @@
 #include "ustr-conf.h"
 #define USTR_CONF_USE_DYNAMIC_CONF USTR_CONF_HAVE_DYNAMIC_CONF
 #define USTR_CONF_e_PROTO  extern
-#define USTR_CONF_i_PROTO  extern inline
+#define USTR_CONF_i_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_E_PROTO  extern
-#define USTR_CONF_I_PROTO  extern inline
+#define USTR_CONF_I_PROTO  extern  __attribute__ ((gnu_inline)) inline
 #define USTR_CONF_EI_PROTO extern
-#define USTR_CONF_II_PROTO extern inline
+#define USTR_CONF_II_PROTO extern  __attribute__ ((gnu_inline)) inline
 #include "ustr-main.h"
 #undef  USTR_CONF_INCLUDE_CODEONLY_HEADERS
 #define USTR_CONF_INCLUDE_CODEONLY_HEADERS 1
@@ -16,5 +16,5 @@
 #undef  USTR_CONF_I_PROTO
 #define USTR_CONF_I_PROTO
 #undef  USTR_CONF_II_PROTO
-#define USTR_CONF_II_PROTO inline
+#define USTR_CONF_II_PROTO  __attribute__ ((gnu_inline)) inline
 #include "ustr-utf8.h"
--
tg: (b148fb7..) fixes/gnu-inline (depends on: upstream)


code:
This test checks whether 'root' is successfully translated to UID/GID 0,
using 'getpwnam' in libmount.  This doesn't work in the chroot because
/etc/passwd doesn't contain an entry for 'root' so skip it.

The second test requires that '/sys/dev/block' is present, which is not
the case inside the build container.

--- util-linux-2.25.2/tests/ts/libmount/optstr	2015-01-23 13:58:41.181151194 +0100
+++ util-linux-2.25.2/tests/ts/libmount/optstr	2015-01-23 13:58:42.829161716 +0100
@@ -108,10 +108,6 @@
 ts_run $TESTPROG --apply --user "noexec,nosuid,loop=/dev/looop0" 0x408 &> $TS_OUTPUT
 ts_finalize_subtest

-ts_init_subtest "fix"
-ts_run $TESTPROG --fix "uid=root,gid=root" &> $TS_OUTPUT
-ts_finalize_subtest
-
 ts_init_subtest "deduplicate"
 ts_run $TESTPROG --dedup bbb,ccc,AAA,xxx,AAA=a,AAA=bbb,ddd,AAA=ccc,fff=eee AAA &> $TS_OUTPUT
 ts_finalize_subtest
--- a/tests/ts/lsblk/lsblk	2019-03-11 21:08:23.734387391 +0100
+++ b/tests/ts/lsblk/lsblk	2019-03-11 21:12:43.635473111 +0100
@@ -22,6 +22,8 @@

 ts_init "$*"

+ts_skip "/sys/dev/block is not available"
+
 ts_check_test_command "$TS_CMD_LSBLK"
 ts_check_prog xz
 ts_check_prog tar


code:
Accept "arm" instead of "armv7" in configure, see
   http://valgrind.10908.n7.nabble.com/building-for-arm-td39382.html .

diff -u -r valgrind-3.11.0.orig/configure valgrind-3.11.0/configure
--- valgrind-3.11.0.orig/configure	2015-10-02 20:37:41.915721386 +0200
+++ valgrind-3.11.0/configure	2015-10-02 20:37:54.886746395 +0200
@@ -5607,7 +5607,7 @@
         ARCH_MAX="s390x"
         ;;

-     armv7*)
+     arm*)
 	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: ok (${host_cpu})" >&5
 $as_echo "ok (${host_cpu})" >&6; }
 	ARCH_MAX="arm"


code:
This patch was copied from Debian.

Description: Fix format load_address for 32 bits architectures
 The offset and load_address are 64bits integers
 On 32bits we have to use strtoull (instead of strtoul) to parse number
 into 64bits unsigned integers. Without this the parsed numbers are
 truncated to 2^32-1.
Author: Sophie Brun <sophie@freexian.com>
Bug-Debian: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=881997
Forwarded: https://bugs.chromium.org/p/chromium/issues/detail?id=786969
Last-Update: 2017-11-20
---
This patch header follows DEP-3: http://dep.debian.net/deps/dep3/
--- a/futility/cmd_bdb.c
+++ b/futility/cmd_bdb.c
@@ -637,7 +637,7 @@ static int do_bdb(int argc, char *argv[]
 			}
 			break;
 		case OPT_OFFSET:
-			offset = strtoul(optarg, &e, 0);
+			offset = strtoull(optarg, &e, 0);
 			if (!*optarg || (e && *e)) {
 				fprintf(stderr, "Invalid --offset\n");
 				parse_error = 1;
@@ -658,7 +658,7 @@ static int do_bdb(int argc, char *argv[]
 			}
 			break;
 		case OPT_LOAD_ADDRESS:
-			load_address = strtoul(optarg, &e, 0);
+			load_address = strtoull(optarg, &e, 0);
 			if (!*optarg || (e && *e)) {
 				fprintf(stderr, "Invalid --load_address\n");
 				parse_error = 1;


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");


code:
This patch is a combination of many of the patches from Debian:
https://sources.debian.org/src/libvcflib/1.0.1+dfsg-3/debian/patches/

---
 Makefile | 63 +++++++++++---------------------------------------------
 1 file changed, 12 insertions(+), 51 deletions(-)

diff --git a/Makefile b/Makefile
index 6b13350..be85f22 100644
--- a/Makefile
+++ b/Makefile
@@ -114,43 +114,25 @@ BIN_SOURCES = src/vcfecho.cpp \
 			  src/vcfnull2ref.cpp \
 			  src/vcfinfosummarize.cpp

-# when we can figure out how to build on mac
-# src/vcfsom.cpp
-
 #BINS = $(BIN_SOURCES:.cpp=)
 BINS = $(addprefix $(BIN_DIR)/,$(notdir $(BIN_SOURCES:.cpp=)))
 SHORTBINS = $(notdir $(BIN_SOURCES:.cpp=))

-TABIX = tabixpp/tabix.o
-FASTAHACK = fastahack/Fasta.o
-SMITHWATERMAN = smithwaterman/SmithWatermanGotoh.o
-REPEATS = smithwaterman/Repeats.o
-INDELALLELE = smithwaterman/IndelAllele.o
-DISORDER = smithwaterman/disorder.o
-LEFTALIGN = smithwaterman/LeftAlign.o
-FSOM = fsom/fsom.o
 FILEVERCMP = filevercmp/filevercmp.o

-# Work out how to find htslib
-# Use the one we ship in tabixpp unless told otherwise by the environment
-HTS_LIB ?= $(VCF_LIB_LOCAL)/tabixpp/htslib/libhts.a
-HTS_INCLUDES ?= -I$(VCF_LIB_LOCAL)/tabixpp/htslib
-HTS_LDFLAGS ?= -L$(VCF_LIB_LOCAL)/tabixpp/htslib -lhts -lbz2 -lm -lz -llzma -pthread
-
-
-INCLUDES = $(HTS_INCLUDES) -I$(INC_DIR)
-LDFLAGS = -L$(LIB_DIR) -lvcflib $(HTS_LDFLAGS) -lpthread -lz -lm -llzma -lbz2
+INCLUDES = -I$(INC_DIR) $(shell pkg-config --cflags htslib fastahack smithwaterman tabixpp)
+LDFLAGS = -L$(LIB_DIR) -lvcflib -lpthread -lz -lstdc++ -lm -llzma -lbz2 $(shell pkg-config --libs htslib fastahack smithwaterman tabixpp)

-all: $(OBJECTS) $(BINS) scriptToBin
+all: $(OBJECTS) $(BINS) scriptToBin libvcflib.a

 scriptToBin: $(BINS)
 	$(CP) scripts/* $(BIN_DIR)

 GIT_VERSION += $(shell git describe --abbrev=4 --dirty --always)

-CXXFLAGS = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x
+CXXFLAGS = -Ofast -D_FILE_OFFSET_BITS=64 -std=c++0x -fPIC
 #CXXFLAGS = -O2
 #CXXFLAGS = -pedantic -Wall -Wshadow -Wpointer-arith -Wcast-qual

@@ -168,7 +150,7 @@ profiling:
 gprof:
 	$(MAKE) CXXFLAGS="$(CXXFLAGS) -pg" all

-$(OBJECTS): $(SOURCES) $(HEADERS) $(TABIX) multichoose pre $(SMITHWATERMAN) $(FILEVERCMP) $(FASTAHACK)
+$(OBJECTS): $(SOURCES) $(HEADERS) multichoose pre $(FILEVERCMP)
 	$(CXX) -c -o $@ src/$(*F).cpp $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) && $(CP) src/*.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/

 multichoose: pre
@@ -177,39 +159,22 @@ multichoose: pre
 intervaltree: pre
 	cd intervaltree && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/

-$(TABIX): pre
-	cd tabixpp && INCLUDES="$(HTS_INCLUDES)" LIBPATH="-L. $(HTS_LDFLAGS)" HTSLIB="$(HTS_LIB)" $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/
-
-$(SMITHWATERMAN): pre
-	cd smithwaterman && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
-
-$(DISORDER): $(SMITHWATERMAN)
-
-$(REPEATS): $(SMITHWATERMAN)
-
-$(LEFTALIGN): $(SMITHWATERMAN)
-
-$(INDELALLELE): $(SMITHWATERMAN)
-
-$(FASTAHACK): pre
-	cd fastahack && $(MAKE) && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) Fasta.o $(VCF_LIB_LOCAL)/$(OBJ_DIR)/
-
-#$(FSOM):
-#	cd fsom && $(CXX) $(CXXFLAGS) -c fsom.c -lm
-
 $(FILEVERCMP): pre
 	cd filevercmp && make && $(CP) *.h* $(VCF_LIB_LOCAL)/$(INC_DIR)/ && $(CP) *.o $(VCF_LIB_LOCAL)/$(INC_DIR)/

 $(SHORTBINS): pre
 	$(MAKE) $(BIN_DIR)/$@

-$(BINS): $(BIN_SOURCES) libvcflib.a $(OBJECTS) $(SMITHWATERMAN) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) pre intervaltree
+$(BINS): $(BIN_SOURCES) libvcflib.so $(OBJECTS) $(SSW) $(FILEVERCMP) pre intervaltree
 	$(CXX) src/$(notdir $@).cpp -o $@ $(INCLUDES) $(LDFLAGS) $(CXXFLAGS) -DVERSION=\"$(GIT_VERSION)\"

-libvcflib.a: $(OBJECTS) $(SMITHWATERMAN) $(REPEATS) $(FASTAHACK) $(DISORDER) $(LEFTALIGN) $(INDELALLELE) $(SSW) $(FILEVERCMP) $(TABIX) pre
-	ar rs libvcflib.a $(OBJECTS) smithwaterman/sw.o $(FASTAHACK) $(SSW) $(FILEVERCMP) $(TABIX)
+libvcflib.a: $(OBJECTS) $(SSW) $(FILEVERCMP) pre
+	ar rs libvcflib.a $(OBJECTS) $(SSW) $(FILEVERCMP)
 	$(CP) libvcflib.a $(LIB_DIR)

+libvcflib.so: $(OBJECTS) $(SSW) $(FILEVERCMP) pre
+	$(CXX) -shared -o libvcflib.so $(OBJECTS) $(SSW) $(FILEVERCMP)
+	$(CP) libvcflib.so $(LIB_DIR)

 test: $(BINS)
 	@prove -Itests/lib -w tests/*.t
@@ -230,16 +195,12 @@ clean:
 	$(RM) $(BINS) $(OBJECTS)
 	$(RM) ssw_cpp.o ssw.o
 	$(RM) libvcflib.a
+	$(RM) libvcflib.so
 	$(RM) -r $(BIN_DIR)
 	$(RM) -r $(LIB_DIR)
 	$(RM) -r $(INC_DIR)
 	$(RM) -r $(OBJ_DIR)
-	$(MAKE) clean -C tabixpp
-	$(MAKE) clean -C smithwaterman
-	$(MAKE) clean -C fastahack
 	$(MAKE) clean -C multichoose
-	$(MAKE) clean -C fsom
-	$(MAKE) clean -C libVCFH
 	$(MAKE) clean -C test
 	$(MAKE) clean -C filevercmp
 	$(MAKE) clean -C intervaltree
--
2.28.0


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:
From: Petter Reinholdtsen <pere@debian.org>
Date: Tue, 22 Sep 2015 15:14:06 +0200
Subject: oggenc: validate count of channels in the header (CVE-2014-9638 &
 CVE-2014-9639)

Author: Kamil Dudka <kdudka@redhat.com>
Origin: http://lists.xiph.org/pipermail/vorbis-dev/2015-February/020423.html
Bug: https://trac.xiph.org/ticket/2136
Bug: https://trac.xiph.org/ticket/2137
Bug-Debian: https://bugs.debian.org/776086
Forwarded: not-needed
Reviewed-By: Petter Reinholdtsen <pere@hungry.com>
Last-Update: 2015-09-22
---
 oggenc/audio.c | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/oggenc/audio.c b/oggenc/audio.c
index 05e42b3..1b3f179 100644
--- a/oggenc/audio.c
+++ b/oggenc/audio.c
@@ -13,6 +13,7 @@
 #include <config.h>
 #endif

+#include <limits.h>
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
@@ -251,6 +252,7 @@ int aiff_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen)
     aiff_fmt format;
     aifffile *aiff = malloc(sizeof(aifffile));
     int i;
+    long channels;

     if(buf[11]=='C')
         aifc=1;
@@ -277,11 +279,16 @@ int aiff_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen)
         return 0;
     }

-    format.channels = READ_U16_BE(buffer);
+    format.channels = channels = READ_U16_BE(buffer);
     format.totalframes = READ_U32_BE(buffer+2);
     format.samplesize = READ_U16_BE(buffer+6);
     format.rate = (int)read_IEEE80(buffer+8);

+    if(channels <= 0L || SHRT_MAX < channels)
+    {
+        fprintf(stderr, _("Warning: Unsupported count of channels in AIFF header\n"));
+        return 0;
+    }
     aiff->bigendian = 1;

     if(aifc)
@@ -412,6 +419,7 @@ int wav_open(FILE *in, oe_enc_opt *opt, unsigned char *oldbuf, int buflen)
     wav_fmt format;
     wavfile *wav = malloc(sizeof(wavfile));
     int i;
+    long channels;

     /* Ok. At this point, we know we have a WAV file. Now we have to detect
      * whether we support the subtype, and we have to find the actual data
@@ -449,12 +457,18 @@ int wav_open(FILE *in, oe_enc_opt *opt, unsigned char *oldbuf, int buflen)
     }

     format.format =      READ_U16_LE(buf);
-    format.channels =    READ_U16_LE(buf+2);
+    format.channels = channels = READ_U16_LE(buf+2);
     format.samplerate =  READ_U32_LE(buf+4);
     format.bytespersec = READ_U32_LE(buf+8);
     format.align =       READ_U16_LE(buf+12);
     format.samplesize =  READ_U16_LE(buf+14);

+    if(channels <= 0L || SHRT_MAX < channels)
+    {
+        fprintf(stderr, _("Warning: Unsupported count of channels in WAV header\n"));
+        return 0;
+    }
+
     if(format.format == -2) /* WAVE_FORMAT_EXTENSIBLE */
     {
       if(len<40)


code:
Index: vorbis-tools/oggenc/oggenc.c
===================================================================
--- vorbis-tools/oggenc/oggenc.c	(revision 19116)
+++ vorbis-tools/oggenc/oggenc.c	(revision 19117)
@@ -98,4 +98,6 @@
               0,0,0.f,
               0, 0, 0, 0, 0};
+    input_format raw_format = {NULL, 0, raw_open, wav_close, "raw",
+      N_("RAW file reader")};

     int i;
@@ -240,6 +242,4 @@
         if(opt.rawmode)
         {
-            input_format raw_format = {NULL, 0, raw_open, wav_close, "raw",
-                N_("RAW file reader")};

             enc_opts.rate=opt.raw_samplerate;
Index: vorbis-tools/oggenc/skeleton.h
===================================================================
--- vorbis-tools/oggenc/skeleton.h	(revision 19116)
+++ vorbis-tools/oggenc/skeleton.h	(revision 19117)
@@ -42,5 +42,5 @@
     ogg_int64_t start_granule;                             /* start granule value */
     ogg_uint32_t preroll;                                   /* preroll */
-    unsigned char granule_shift; // a 8-bit field           /* 1 byte value holding the granule shift */
+    unsigned char granule_shift;                            /* 1 byte value holding the granule shift */
     char *message_header_fields;                            /* holds all the message header fields */
     /* current total size of the message header fields, for realloc purpose, initially zero */


code:
Upstream fix for CVE-2015-6749.
https://trac.xiph.org/ticket/2212

From 04815d3e1bfae3a6cdfb2c25358a5a72b61299f7 Mon Sep 17 00:00:00 2001
From: Mark Harris <mark.hsj@gmail.com>
Date: Sun, 30 Aug 2015 05:54:46 -0700
Subject: [PATCH] oggenc: Fix large alloca on bad AIFF input

Fixes #2212
---
 oggenc/audio.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/oggenc/audio.c b/oggenc/audio.c
index 477da8c..4921fb9 100644
--- a/oggenc/audio.c
+++ b/oggenc/audio.c
@@ -245,8 +245,8 @@ static int aiff_permute_matrix[6][6] =
 int aiff_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen)
 {
     int aifc; /* AIFC or AIFF? */
-    unsigned int len;
-    unsigned char *buffer;
+    unsigned int len, readlen;
+    unsigned char buffer[22];
     unsigned char buf2[8];
     aiff_fmt format;
     aifffile *aiff = malloc(sizeof(aifffile));
@@ -269,9 +269,9 @@ int aiff_open(FILE *in, oe_enc_opt *opt, unsigned char *buf, int buflen)
         return 0; /* Weird common chunk */
     }

-    buffer = alloca(len);
-
-    if(fread(buffer,1,len,in) < len)
+    readlen = len < sizeof(buffer) ? len : sizeof(buffer);
+    if(fread(buffer,1,readlen,in) < readlen ||
+       (len > readlen && !seek_forward(in, len-readlen)))
     {
         fprintf(stderr, _("Warning: Unexpected EOF in reading AIFF header\n"));
         return 0;
--
2.5.0


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:
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:
Make weasyprint load dynamic libraries from hard-coded path.

From NixOS
pkgs/development/python-modules/weasyprint/library-paths.patch

diff --git a/weasyprint/fonts.py b/weasyprint/fonts.py
index 377716c1..2016e01c 100644
--- a/weasyprint/fonts.py
+++ b/weasyprint/fonts.py
@@ -48,11 +48,8 @@ else:
     # with OSError: dlopen() failed to load a library: cairo / cairo-2
     # So let's hope we find the same file as cairo already did ;)
     # Same applies to pangocairo requiring pangoft2
-    fontconfig = dlopen(ffi, 'fontconfig', 'libfontconfig',
-                        'libfontconfig-1.dll',
-                        'libfontconfig.so.1', 'libfontconfig-1.dylib')
-    pangoft2 = dlopen(ffi, 'pangoft2-1.0', 'libpangoft2-1.0-0',
-                      'libpangoft2-1.0.so', 'libpangoft2-1.0.dylib')
+    fontconfig = dlopen(ffi, '@fontconfig@')
+    pangoft2 = dlopen(ffi, '@pangoft2@')

     ffi.cdef('''
         // FontConfig
diff --git a/weasyprint/text.py b/weasyprint/text.py
index 035074e9..08e40395 100644
--- a/weasyprint/text.py
+++ b/weasyprint/text.py
@@ -243,12 +243,9 @@ def dlopen(ffi, *names):
     return ffi.dlopen(names[0])  # pragma: no cover

-gobject = dlopen(ffi, 'gobject-2.0', 'libgobject-2.0-0', 'libgobject-2.0.so',
-                 'libgobject-2.0.dylib')
-pango = dlopen(ffi, 'pango-1.0', 'libpango-1.0-0', 'libpango-1.0.so',
-               'libpango-1.0.dylib')
-pangocairo = dlopen(ffi, 'pangocairo-1.0', 'libpangocairo-1.0-0',
-                    'libpangocairo-1.0.so', 'libpangocairo-1.0.dylib')
+gobject = dlopen(ffi, '@gobject@')
+pango = dlopen(ffi, '@pango@')
+pangocairo = dlopen(ffi, '@pangocairo@')

 gobject.g_type_init()


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.