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.

--- 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

license: mit


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:
Fix build failure with glibc 2.26.

Patch copied from upstream source repository:
https://sourceware.org/git/?p=valgrind.git;a=commit;h=2b5eab6a8db1b0487a3ad7fc4e7eeda6d3513626

diff --git a/memcheck/tests/linux/stack_changes.c b/memcheck/tests/linux/stack_changes.c
index a978fc2..7f97b90 100644
--- a/memcheck/tests/linux/stack_changes.c
+++ b/memcheck/tests/linux/stack_changes.c
@@ -10,7 +10,7 @@
 // This test is checking the libc context calls (setcontext, etc.) and
 // checks that Valgrind notices their stack changes properly.

-typedef  struct ucontext  mycontext;
+typedef  ucontext_t  mycontext;

 mycontext ctx1, ctx2, oldc;
 int count;


code:
Patch taken from Debian: revert changes that prevent building against freerdp
version 1.1 branch.

From 8ebc0685b85e0d1f70eb00171f2e7712de3d44bd Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Thu, 22 Sep 2016 01:15:55 +0200
Subject: [PATCH 1/2] Revert "Improve FreeRDP authentication failure handling"

This reverts commit d7b4f88943e8615d252d27e1efc58cb64a9e1821.
---
 plugins/rdp/vinagre-rdp-tab.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index b731f9b..8572bc3 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -1195,8 +1195,8 @@ open_freerdp (VinagreRdpTab *rdp_tab)
   VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
   GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
   gboolean              success = TRUE;
+  gboolean              authentication_error = FALSE;
   gboolean              cancelled = FALSE;
-  guint                 authentication_errors = 0;

   priv->events = g_queue_new ();

@@ -1205,12 +1205,14 @@ open_freerdp (VinagreRdpTab *rdp_tab)

   do
     {
+      authentication_error = FALSE;
+
       /* Run FreeRDP session */
       success = freerdp_connect (priv->freerdp_session);
       if (!success)
         {
-          authentication_errors += freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
-                                   freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
+          authentication_error = freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
+                                 freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;

           cancelled = freerdp_get_last_error (priv->freerdp_session->context) == 0x2000b;

@@ -1218,7 +1220,7 @@ open_freerdp (VinagreRdpTab *rdp_tab)
           init_freerdp (rdp_tab);
         }
     }
-  while (!success && authentication_errors < 3);
+  while (!success && authentication_error);

   if (!success)
     {
--
2.9.3


code:
Patch taken from Debian: revert changes that prevent building against freerdp
version 1.1 branch.

From bb1828b6b7eb29bb037bcc687cf10f916ddc7561 Mon Sep 17 00:00:00 2001
From: Michael Biebl <biebl@debian.org>
Date: Thu, 22 Sep 2016 01:18:16 +0200
Subject: [PATCH 2/2] Revert "Store credentials for RDP"

This reverts commit 60dea279a24c7f0e398b89a0a60d45e80087ed1d.
---
 plugins/rdp/vinagre-rdp-connection.c |  22 +---
 plugins/rdp/vinagre-rdp-plugin.c     |  29 +----
 plugins/rdp/vinagre-rdp-tab.c        | 231 +++++++++++++++++------------------
 3 files changed, 123 insertions(+), 159 deletions(-)

diff --git a/plugins/rdp/vinagre-rdp-connection.c b/plugins/rdp/vinagre-rdp-connection.c
index f0ff02b..c5f6ed1 100644
--- a/plugins/rdp/vinagre-rdp-connection.c
+++ b/plugins/rdp/vinagre-rdp-connection.c
@@ -127,25 +127,9 @@ rdp_parse_item (VinagreConnection *conn, xmlNode *root)
 static void
 rdp_parse_options_widget (VinagreConnection *conn, GtkWidget *widget)
 {
-  const gchar *text;
-  GtkWidget   *u_entry, *d_entry, *spin_button, *scaling_button;
-  gboolean     scaling;
-  guint        width, height;
-
-  d_entry = g_object_get_data (G_OBJECT (widget), "domain_entry");
-  if (!d_entry)
-    {
-      g_warning ("Wrong widget passed to rdp_parse_options_widget()");
-      return;
-    }
-
-  text = gtk_entry_get_text (GTK_ENTRY (d_entry));
-  vinagre_cache_prefs_set_string  ("rdp-connection", "domain", text);
-
-  g_object_set (conn,
-		"domain", text != NULL && *text != '\0' ? text : NULL,
-		NULL);
-
+  GtkWidget *u_entry, *spin_button, *scaling_button;
+  gboolean   scaling;
+  guint      width, height;

   u_entry = g_object_get_data (G_OBJECT (widget), "username_entry");
   if (!u_entry)
diff --git a/plugins/rdp/vinagre-rdp-plugin.c b/plugins/rdp/vinagre-rdp-plugin.c
index 4751102..f41da37 100644
--- a/plugins/rdp/vinagre-rdp-plugin.c
+++ b/plugins/rdp/vinagre-rdp-plugin.c
@@ -100,7 +100,7 @@ vinagre_rdp_plugin_init (VinagreRdpPlugin *plugin)
 static GtkWidget *
 impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
 {
-  GtkWidget *grid, *label, *u_entry, *d_entry, *spin_button, *check;
+  GtkWidget *grid, *label, *u_entry, *spin_button, *check;
   gchar     *str;
   gint       width, height;

@@ -146,29 +146,10 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
   g_free (str);

-  label = gtk_label_new_with_mnemonic (_("_Domain:"));
-  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
-  gtk_widget_set_margin_left (label, 12);
-
-  d_entry = gtk_entry_new ();
-  /* Translators: This is the tooltip for the domain field in a RDP connection */
-  gtk_widget_set_tooltip_text (d_entry, _("Optional."));
-  g_object_set_data (G_OBJECT (grid), "domain_entry", d_entry);
-  gtk_grid_attach (GTK_GRID (grid), d_entry, 1, 3, 1, 1);
-  gtk_label_set_mnemonic_widget (GTK_LABEL (label), d_entry);
-  str = g_strdup (VINAGRE_IS_CONNECTION (conn) ?
-		  vinagre_connection_get_domain (conn) :
-		  vinagre_cache_prefs_get_string  ("rdp-connection", "domain", ""));
-  gtk_entry_set_text (GTK_ENTRY (d_entry), str);
-  gtk_entry_set_activates_default (GTK_ENTRY (d_entry), TRUE);
-  g_free (str);
-
-
   /* Host width */
   label = gtk_label_new_with_mnemonic (_("_Width:"));
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, 3, 1, 1);
   gtk_widget_set_margin_left (label, 12);

   spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
@@ -176,7 +157,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
   gtk_widget_set_tooltip_text (spin_button, _("Set width of the remote desktop"));
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_WIDTH);
   g_object_set_data (G_OBJECT (grid), "width_spin_button", spin_button);
-  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 4, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 3, 1, 1);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
   width = VINAGRE_IS_CONNECTION (conn) ?
           vinagre_connection_get_width (conn) :
@@ -188,7 +169,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
   /* Host height */
   label = gtk_label_new_with_mnemonic (_("_Height:"));
   gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
-  gtk_grid_attach (GTK_GRID (grid), label, 0, 5, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), label, 0, 4, 1, 1);
   gtk_widget_set_margin_left (label, 12);

   spin_button = gtk_spin_button_new_with_range (MIN_SIZE, MAX_SIZE, 1);
@@ -196,7 +177,7 @@ impl_get_connect_widget (VinagreProtocol *plugin, VinagreConnection *conn)
   gtk_widget_set_tooltip_text (spin_button, _("Set height of the remote desktop"));
   gtk_spin_button_set_value (GTK_SPIN_BUTTON (spin_button), DEFAULT_HEIGHT);
   g_object_set_data (G_OBJECT (grid), "height_spin_button", spin_button);
-  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 5, 1, 1);
+  gtk_grid_attach (GTK_GRID (grid), spin_button, 1, 4, 1, 1);
   gtk_label_set_mnemonic_widget (GTK_LABEL (label), spin_button);
   height = VINAGRE_IS_CONNECTION (conn) ?
            vinagre_connection_get_height (conn) :
diff --git a/plugins/rdp/vinagre-rdp-tab.c b/plugins/rdp/vinagre-rdp-tab.c
index 8572bc3..f3d9c08 100644
--- a/plugins/rdp/vinagre-rdp-tab.c
+++ b/plugins/rdp/vinagre-rdp-tab.c
@@ -70,8 +70,6 @@ struct _VinagreRdpTabPrivate
   gboolean         scaling;
   double           scale;
   double           offset_x, offset_y;
-
-  guint            authentication_attempts;
 };

 G_DEFINE_TYPE (VinagreRdpTab, vinagre_rdp_tab, VINAGRE_TYPE_TAB)
@@ -611,7 +609,6 @@ frdp_post_connect (freerdp *instance)
                               0, 0,
                               gdi->width, gdi->height);

-  vinagre_tab_save_credentials_in_keyring (VINAGRE_TAB (rdp_tab));
   vinagre_tab_add_recent_used (VINAGRE_TAB (rdp_tab));
   vinagre_tab_set_state (VINAGRE_TAB (rdp_tab), VINAGRE_TAB_STATE_CONNECTED);

@@ -862,76 +859,114 @@ frdp_mouse_moved (GtkWidget      *widget,
   return TRUE;
 }

+static void
+entry_text_changed_cb (GtkEntry   *entry,
+                       GtkBuilder *builder)
+{
+  const gchar *text;
+  GtkWidget   *widget;
+  gsize        username_length;
+  gsize        password_length;
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "username_entry"));
+  text = gtk_entry_get_text (GTK_ENTRY (widget));
+  username_length = strlen (text);
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
+  text = gtk_entry_get_text (GTK_ENTRY (widget));
+  password_length = strlen (text);
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "ok_button"));
+  gtk_widget_set_sensitive (widget, password_length > 0 && username_length > 0);
+}
+
 static gboolean
 frdp_authenticate (freerdp  *instance,
                    char    **username,
                    char    **password,
                    char    **domain)
 {
-  VinagreTab           *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
-  VinagreRdpTab        *rdp_tab = VINAGRE_RDP_TAB (tab);
-  VinagreRdpTabPrivate *priv = rdp_tab->priv;
-  VinagreConnection    *conn = vinagre_tab_get_conn (tab);
-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-  gboolean              save_in_keyring = FALSE;
-  gchar                *keyring_domain = NULL;
-  gchar                *keyring_username = NULL;
-  gchar                *keyring_password = NULL;
+  VinagreTab        *tab = VINAGRE_TAB (((frdpContext *) instance->context)->rdp_tab);
+  VinagreConnection *conn = vinagre_tab_get_conn (tab);
+  const gchar       *user_name;
+  const gchar       *domain_name;
+  GtkBuilder        *builder;
+  GtkWidget         *dialog;
+  GtkWidget         *widget;
+  GtkWidget         *username_entry;
+  GtkWidget         *password_entry;
+  GtkWidget         *domain_entry;
+  gboolean           save_credential_check_visible;
+  gboolean           domain_label_visible;
+  gboolean           domain_entry_visible;
+  gint               response;

-  priv->authentication_attempts++;
+  builder = vinagre_utils_get_builder ();

-  if (priv->authentication_attempts == 1)
-    {
-      vinagre_tab_find_credentials_in_keyring (tab, &keyring_domain, &keyring_username, &keyring_password);
-      if (keyring_password != NULL && keyring_username != NULL)
-        {
-          *domain = keyring_domain;
-          *username = keyring_username;
-          *password = keyring_password;
+  dialog = GTK_WIDGET (gtk_builder_get_object (builder, "auth_required_dialog"));
+  gtk_window_set_modal ((GtkWindow *) dialog, TRUE);
+  gtk_window_set_transient_for ((GtkWindow *) dialog, GTK_WINDOW (vinagre_tab_get_window (tab)));

-          return TRUE;
-        }
-      else
-        {
-          g_free (keyring_domain);
-          g_free (keyring_username);
-          g_free (keyring_password);
-        }
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "host_label"));
+  gtk_label_set_text (GTK_LABEL (widget), vinagre_connection_get_host (conn));
+
+  username_entry = GTK_WIDGET (gtk_builder_get_object (builder, "username_entry"));
+  password_entry = GTK_WIDGET (gtk_builder_get_object (builder, "password_entry"));
+  domain_entry = GTK_WIDGET (gtk_builder_get_object (builder, "domain_entry"));
+
+  if (*username != NULL && *username[0] != '\0')
+    {
+      gtk_entry_set_text (GTK_ENTRY (username_entry), *username);
+      gtk_widget_grab_focus (password_entry);
     }

-  if (vinagre_utils_request_credential (window,
-                                        "RDP",
-                                        vinagre_connection_get_host (conn),
-                                        vinagre_connection_get_domain (conn),
-                                        vinagre_connection_get_username (conn),
-                                        TRUE,
-                                        TRUE,
-                                        TRUE,
-                                        20,
-                                        domain,
-                                        username,
-                                        password,
-                                        &save_in_keyring))
+  g_signal_connect (username_entry, "changed", G_CALLBACK (entry_text_changed_cb), builder);
+  g_signal_connect (password_entry, "changed", G_CALLBACK (entry_text_changed_cb), builder);
+
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "save_credential_check"));
+  save_credential_check_visible = gtk_widget_get_visible (widget);
+  gtk_widget_set_visible (widget, FALSE);
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "domain_label"));
+  domain_label_visible = gtk_widget_get_visible (widget);
+  gtk_widget_set_visible (widget, TRUE);
+
+  domain_entry_visible = gtk_widget_get_visible (domain_entry);
+  gtk_widget_set_visible (domain_entry, TRUE);
+
+
+  response = gtk_dialog_run (GTK_DIALOG (dialog));
+  gtk_widget_hide (dialog);
+
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "save_credential_check"));
+  gtk_widget_set_visible (widget, save_credential_check_visible);
+
+  widget = GTK_WIDGET (gtk_builder_get_object (builder, "domain_label"));
+  gtk_widget_set_visible (widget, domain_label_visible);
+
+  gtk_widget_set_visible (domain_entry, domain_entry_visible);
+
+
+  if (response == GTK_RESPONSE_OK)
     {
-      if (*domain && **domain != '\0')
-        vinagre_connection_set_domain (conn, *domain);
+      domain_name = gtk_entry_get_text (GTK_ENTRY (domain_entry));
+      if (g_strcmp0 (*domain, domain_name) != 0)
+        *domain = g_strdup (domain_name);

-      if (*username && **username != '\0')
-        vinagre_connection_set_username (conn, *username);
+      user_name = gtk_entry_get_text (GTK_ENTRY (username_entry));
+      if (g_strcmp0 (*username, user_name) != 0)
+        *username = g_strdup (user_name);

-      if (*password && **password != '\0')
-        vinagre_connection_set_password (conn, *password);
+      *password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)));

-      vinagre_tab_set_save_credentials (tab, save_in_keyring);
+      return TRUE;
     }
   else
     {
-      vinagre_tab_remove_from_notebook (tab);
-
       return FALSE;
     }
-
-  return TRUE;
 }

 static BOOL
@@ -1028,25 +1063,30 @@ frdp_changed_certificate_verify (freerdp *instance,
 #endif

 static void
-init_freerdp (VinagreRdpTab *rdp_tab)
+open_freerdp (VinagreRdpTab *rdp_tab)
 {
   VinagreRdpTabPrivate *priv = rdp_tab->priv;
-  rdpSettings          *settings;
   VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
   VinagreConnection    *conn = vinagre_tab_get_conn (tab);
-  gboolean              scaling;
-  gchar                *hostname;
-  gint                  width, height;
-  gint                  port;
+  rdpSettings          *settings;
+  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
+  gboolean              success = TRUE;
+  gboolean              fullscreen, scaling;
+  gchar                *hostname, *username;
+  gint                  port, width, height;

   g_object_get (conn,
                 "port", &port,
                 "host", &hostname,
                 "width", &width,
                 "height", &height,
+                "fullscreen", &fullscreen,
                 "scaling", &scaling,
+                "username", &username,
                 NULL);

+  priv->events = g_queue_new ();
+
   /* Setup FreeRDP session */
   priv->freerdp_session = freerdp_new ();
   priv->freerdp_session->PreConnect = frdp_pre_connect;
@@ -1111,6 +1151,17 @@ init_freerdp (VinagreRdpTab *rdp_tab)
   settings->port = port;
 #endif

+  /* Set username */
+  username = g_strstrip (username);
+  if (username != NULL && username[0] != '\0')
+    {
+#if HAVE_FREERDP_1_1
+      settings->Username = g_strdup (username);
+#else
+      settings->username = g_strdup (username);
+#endif
+    }
+
   /* Set keyboard layout */
 #if HAVE_FREERDP_1_1
   freerdp_keyboard_init (KBD_US);
@@ -1120,24 +1171,6 @@ init_freerdp (VinagreRdpTab *rdp_tab)

   /* Allow font smoothing by default */
   settings->AllowFontSmoothing = TRUE;
-}
-
-static void
-init_display (VinagreRdpTab *rdp_tab)
-{
-  VinagreRdpTabPrivate *priv = rdp_tab->priv;
-  VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
-  VinagreConnection    *conn = vinagre_tab_get_conn (tab);
-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-  gboolean              fullscreen, scaling;
-  gint                  width, height;
-
-  g_object_get (conn,
-                "width", &width,
-                "height", &height,
-                "fullscreen", &fullscreen,
-                "scaling", &scaling,
-                NULL);

   /* Setup display for FreeRDP session */
   priv->display = gtk_drawing_area_new ();
@@ -1186,54 +1219,20 @@ init_display (VinagreRdpTab *rdp_tab)
   priv->key_release_handler_id = g_signal_connect (GTK_WIDGET (tab), "key-release-event",
                                                    G_CALLBACK (frdp_key_pressed),
                                                    rdp_tab);
-}
-
-static void
-open_freerdp (VinagreRdpTab *rdp_tab)
-{
-  VinagreRdpTabPrivate *priv = rdp_tab->priv;
-  VinagreTab           *tab = VINAGRE_TAB (rdp_tab);
-  GtkWindow            *window = GTK_WINDOW (vinagre_tab_get_window (tab));
-  gboolean              success = TRUE;
-  gboolean              authentication_error = FALSE;
-  gboolean              cancelled = FALSE;
-
-  priv->events = g_queue_new ();
-
-  init_freerdp (rdp_tab);
-  init_display (rdp_tab);
-
-  do
-    {
-      authentication_error = FALSE;

-      /* Run FreeRDP session */
-      success = freerdp_connect (priv->freerdp_session);
-      if (!success)
-        {
-          authentication_error = freerdp_get_last_error (priv->freerdp_session->context) == 0x20009 ||
-                                 freerdp_get_last_error (priv->freerdp_session->context) == 0x2000c;
-
-          cancelled = freerdp_get_last_error (priv->freerdp_session->context) == 0x2000b;
-
-          freerdp_free (priv->freerdp_session);
-          init_freerdp (rdp_tab);
-        }
-    }
-  while (!success && authentication_error);
+  /* Run FreeRDP session */
+  success = freerdp_connect (priv->freerdp_session);

   if (!success)
     {
       gtk_window_unfullscreen (window);
-      if (!cancelled)
-        vinagre_utils_show_error_dialog (_("Error connecting to host."),
-                                         NULL,
-                                         window);
+      vinagre_utils_show_error_dialog (_("Error connecting to host."),
+                                       NULL,
+                                       window);
       g_idle_add ((GSourceFunc) idle_close, rdp_tab);
     }
   else
     {
-      priv->authentication_attempts = 0;
       priv->update_id = g_idle_add ((GSourceFunc) update, rdp_tab);
     }
 }
--
2.9.3


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
+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 = -Wall -Wno-sign-compare -O3 -g -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 = -Wall -Wno-sign-compare -O3 -g
-
 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:
Fix CVE-2018-6767:
https://nvd.nist.gov/vuln/detail/CVE-2018-6767
https://security-tracker.debian.org/tracker/CVE-2018-6767

Patch copied from upstream source repository:
https://github.com/dbry/WavPack/commit/d5bf76b5a88d044a1be1d5656698e3ba737167e5

From d5bf76b5a88d044a1be1d5656698e3ba737167e5 Mon Sep 17 00:00:00 2001
From: David Bryant <david@wavpack.com>
Date: Sun, 4 Feb 2018 11:28:15 -0800
Subject: [PATCH] issue #27, do not overwrite stack on corrupt RF64 file

---
 cli/riff.c | 39 ++++++++++++++++++++++++++++++++-------
 1 file changed, 32 insertions(+), 7 deletions(-)

diff --git a/cli/riff.c b/cli/riff.c
index 8b1af45..de98c1e 100644
--- a/cli/riff.c
+++ b/cli/riff.c
@@ -42,6 +42,7 @@ typedef struct {

 #pragma pack(pop)

+#define CS64ChunkFormat "4D"
 #define DS64ChunkFormat "DDDL"

 #define WAVPACK_NO_ERROR    0
@@ -101,13 +102,13 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack

         if (!strncmp (chunk_header.ckID, "ds64", 4)) {
             if (chunk_header.ckSize < sizeof (DS64Chunk) ||
-                !DoReadFile (infile, &ds64_chunk, chunk_header.ckSize, &bcount) ||
-                bcount != chunk_header.ckSize) {
+                !DoReadFile (infile, &ds64_chunk, sizeof (DS64Chunk), &bcount) ||
+                bcount != sizeof (DS64Chunk)) {
                     error_line ("%s is not a valid .WAV file!", infilename);
                     return WAVPACK_SOFT_ERROR;
             }
             else if (!(config->qmode & QMODE_NO_STORE_WRAPPER) &&
-                !WavpackAddWrapper (wpc, &ds64_chunk, chunk_header.ckSize)) {
+                !WavpackAddWrapper (wpc, &ds64_chunk, sizeof (DS64Chunk))) {
                     error_line ("%s", WavpackGetErrorMessage (wpc));
                     return WAVPACK_SOFT_ERROR;
             }
@@ -315,10 +316,11 @@ int ParseRiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack

 int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples, int qmode)
 {
-    int do_rf64 = 0, write_junk = 1;
+    int do_rf64 = 0, write_junk = 1, table_length = 0;
     ChunkHeader ds64hdr, datahdr, fmthdr;
     RiffChunkHeader riffhdr;
     DS64Chunk ds64_chunk;
+    CS64Chunk cs64_chunk;
     JunkChunk junkchunk;
     WaveHeader wavhdr;
     uint32_t bcount;
@@ -380,6 +382,7 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples,
     strncpy (riffhdr.formType, "WAVE", sizeof (riffhdr.formType));
     total_riff_bytes = sizeof (riffhdr) + wavhdrsize + sizeof (datahdr) + ((total_data_bytes + 1) & ~(int64_t)1);
     if (do_rf64) total_riff_bytes += sizeof (ds64hdr) + sizeof (ds64_chunk);
+    total_riff_bytes += table_length * sizeof (CS64Chunk);
     if (write_junk) total_riff_bytes += sizeof (junkchunk);
     strncpy (fmthdr.ckID, "fmt ", sizeof (fmthdr.ckID));
     strncpy (datahdr.ckID, "data", sizeof (datahdr.ckID));
@@ -394,11 +397,12 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples,

     if (do_rf64) {
         strncpy (ds64hdr.ckID, "ds64", sizeof (ds64hdr.ckID));
-        ds64hdr.ckSize = sizeof (ds64_chunk);
+        ds64hdr.ckSize = sizeof (ds64_chunk) + (table_length * sizeof (CS64Chunk));
         CLEAR (ds64_chunk);
         ds64_chunk.riffSize64 = total_riff_bytes;
         ds64_chunk.dataSize64 = total_data_bytes;
         ds64_chunk.sampleCount64 = total_samples;
+        ds64_chunk.tableLength = table_length;
         riffhdr.ckSize = (uint32_t) -1;
         datahdr.ckSize = (uint32_t) -1;
         WavpackNativeToLittleEndian (&ds64hdr, ChunkHeaderFormat);
@@ -409,6 +413,14 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples,
         datahdr.ckSize = (uint32_t) total_data_bytes;
     }

+    // this "table" is just a dummy placeholder for testing (normally not written)
+
+    if (table_length) {
+        strncpy (cs64_chunk.ckID, "dmmy", sizeof (cs64_chunk.ckID));
+        cs64_chunk.chunkSize64 = 12345678;
+        WavpackNativeToLittleEndian (&cs64_chunk, CS64ChunkFormat);
+    }
+
     // write the RIFF chunks up to just before the data starts

     WavpackNativeToLittleEndian (&riffhdr, ChunkHeaderFormat);
@@ -418,8 +430,21 @@ int WriteRiffHeader (FILE *outfile, WavpackContext *wpc, int64_t total_samples,

     if (!DoWriteFile (outfile, &riffhdr, sizeof (riffhdr), &bcount) || bcount != sizeof (riffhdr) ||
         (do_rf64 && (!DoWriteFile (outfile, &ds64hdr, sizeof (ds64hdr), &bcount) || bcount != sizeof (ds64hdr))) ||
-        (do_rf64 && (!DoWriteFile (outfile, &ds64_chunk, sizeof (ds64_chunk), &bcount) || bcount != sizeof (ds64_chunk))) ||
-        (write_junk && (!DoWriteFile (outfile, &junkchunk, sizeof (junkchunk), &bcount) || bcount != sizeof (junkchunk))) ||
+        (do_rf64 && (!DoWriteFile (outfile, &ds64_chunk, sizeof (ds64_chunk), &bcount) || bcount != sizeof (ds64_chunk)))) {
+            error_line ("can't write .WAV data, disk probably full!");
+            return FALSE;
+    }
+
+    // again, this is normally not written except for testing
+
+    while (table_length--)
+        if (!DoWriteFile (outfile, &cs64_chunk, sizeof (cs64_chunk), &bcount) || bcount != sizeof (cs64_chunk)) {
+            error_line ("can't write .WAV data, disk probably full!");
+            return FALSE;
+        }
+
+
+    if ((write_junk && (!DoWriteFile (outfile, &junkchunk, sizeof (junkchunk), &bcount) || bcount != sizeof (junkchunk))) ||
         !DoWriteFile (outfile, &fmthdr, sizeof (fmthdr), &bcount) || bcount != sizeof (fmthdr) ||
         !DoWriteFile (outfile, &wavhdr, wavhdrsize, &bcount) || bcount != wavhdrsize ||
         !DoWriteFile (outfile, &datahdr, sizeof (datahdr), &bcount) || bcount != sizeof (datahdr)) {


code:
Fix CVE-2018-7253:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7253

Copied from upstream:
https://github.com/dbry/WavPack/commit/36a24c7881427d2e1e4dc1cef58f19eee0d13aec

diff --git a/cli/dsdiff.c b/cli/dsdiff.c
index 410dc1c..c016df9 100644
--- a/cli/dsdiff.c
+++ b/cli/dsdiff.c
@@ -153,7 +153,17 @@ int ParseDsdiffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpa
                 error_line ("dsdiff file version = 0x%08x", version);
         }
         else if (!strncmp (dff_chunk_header.ckID, "PROP", 4)) {
-            char *prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize);
+            char *prop_chunk;
+
+            if (dff_chunk_header.ckDataSize < 4 || dff_chunk_header.ckDataSize > 1024) {
+                error_line ("%s is not a valid .DFF file!", infilename);
+                return WAVPACK_SOFT_ERROR;
+            }
+
+            if (debug_logging_mode)
+                error_line ("got PROP chunk of %d bytes total", (int) dff_chunk_header.ckDataSize);
+
+            prop_chunk = malloc ((size_t) dff_chunk_header.ckDataSize);

             if (!DoReadFile (infile, prop_chunk, (uint32_t) dff_chunk_header.ckDataSize, &bcount) ||
                 bcount != dff_chunk_header.ckDataSize) {


code:
Fix CVE-2018-7254:
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2018-7254

Copied from upstream:
https://github.com/dbry/WavPack/commit/8e3fe45a7bac31d9a3b558ae0079e2d92a04799e

diff --git a/cli/caff.c b/cli/caff.c
index ae57c4b..6248a71 100644
--- a/cli/caff.c
+++ b/cli/caff.c
@@ -89,8 +89,8 @@ typedef struct

 #define CAFChannelDescriptionFormat "LLLLL"

-static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21 };
-static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16 };
+static const char TMH_full [] = { 1,2,3,13,9,10,5,6,12,14,15,16,17,9,4,18,7,8,19,20,21,0 };
+static const char TMH_std [] = { 1,2,3,11,8,9,5,6,10,12,13,14,15,7,4,16,0 };

 static struct {
     uint32_t mChannelLayoutTag;     // Core Audio layout, 100 - 146 in high word, num channels in low word
@@ -274,10 +274,19 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack
             }
         }
         else if (!strncmp (caf_chunk_header.mChunkType, "chan", 4)) {
-            CAFChannelLayout *caf_channel_layout = malloc ((size_t) caf_chunk_header.mChunkSize);
+            CAFChannelLayout *caf_channel_layout;

-            if (caf_chunk_header.mChunkSize < sizeof (CAFChannelLayout) ||
-                !DoReadFile (infile, caf_channel_layout, (uint32_t) caf_chunk_header.mChunkSize, &bcount) ||
+            if (caf_chunk_header.mChunkSize < sizeof (CAFChannelLayout) || caf_chunk_header.mChunkSize > 1024) {
+                error_line ("this .CAF file has an invalid 'chan' chunk!");
+                return WAVPACK_SOFT_ERROR;
+            }
+
+            if (debug_logging_mode)
+                error_line ("'chan' chunk is %d bytes", (int) caf_chunk_header.mChunkSize);
+
+            caf_channel_layout = malloc ((size_t) caf_chunk_header.mChunkSize);
+
+            if (!DoReadFile (infile, caf_channel_layout, (uint32_t) caf_chunk_header.mChunkSize, &bcount) ||
                 bcount != caf_chunk_header.mChunkSize) {
                     error_line ("%s is not a valid .CAF file!", infilename);
                     free (caf_channel_layout);
@@ -495,8 +504,15 @@ int ParseCaffHeaderConfig (FILE *infile, char *infilename, char *fourcc, Wavpack
         }
         else {          // just copy unknown chunks to output file

-            int bytes_to_copy = (uint32_t) caf_chunk_header.mChunkSize;
-            char *buff = malloc (bytes_to_copy);
+            uint32_t bytes_to_copy = (uint32_t) caf_chunk_header.mChunkSize;
+            char *buff;
+
+            if (caf_chunk_header.mChunkSize < 0 || caf_chunk_header.mChunkSize > 1048576) {
+                error_line ("%s is not a valid .CAF file!", infilename);
+                return WAVPACK_SOFT_ERROR;
+            }
+
+            buff = malloc (bytes_to_copy);

             if (debug_logging_mode)
                 error_line ("extra unknown chunk \"%c%c%c%c\" of %d bytes",


code:
Get Python LDFLAGS from 'pkg-config'.

The other approach is more complex and gets it wrong: it returns
"-L/path/to/python/lib/python-2.7.10/lib/python2.7/config -lpython -lwhatever";
since that config/ sub-directory contains libpython2.7.a, we end up
statically linking Python in Weechat's python.so, which we do not want.

--- weechat-1.3/configure.ac	2015-08-16 08:27:07.000000000 +0200
+++ weechat-1.3/configure.ac	2015-11-29 18:18:52.975197048 +0100
@@ -535,29 +535,7 @@ if test "x$enable_python" = "xyes" ; the
             if test -r "$PYTHON_INCLUDE/Python.h"; then
                 PYTHON_CFLAGS="-I$PYTHON_INCLUDE"
                 AC_MSG_RESULT(found)
-                PYTHON_LIB=`$PYTHON -c "import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_config_var('LIBPL'))"`
-                PYTHON_LFLAGS="-lpython$PYTHON_VERSION "`$PYTHON -c "import sys, distutils.sysconfig; sys.stdout.write(distutils.sysconfig.get_config_var('LIBS')+' '+distutils.sysconfig.get_config_var('SYSLIBS')+' '+distutils.sysconfig.get_config_var('LINKFORSHARED'))"`
-                AC_MSG_CHECKING(for Python library)
-                if test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.so"; then
-                   PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
-                   AC_MSG_RESULT(found)
-                elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.a"; then
-                   PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
-                   AC_MSG_RESULT(found)
-                elif test -r "$PYTHON_LIB/libpython$PYTHON_VERSION.dll.a"; then
-                   PYTHON_LFLAGS="-L$PYTHON_LIB $PYTHON_LFLAGS"
-                   AC_MSG_RESULT(found)
-                elif test -r "$PYTHON_SYSPREFIX/lib/libpython$PYTHON_VERSION.so"; then
-                   PYTHON_LFLAGS="-L$PYTHON_SYSPREFIX/lib/ $PYTHON_LFLAGS"
-                   AC_MSG_RESULT(found)
-                else
-                    AC_MSG_WARN([
-*** Python library couldn't be found on your system.
-*** Try to install it with your software package manager.
-*** WeeChat will be built without Python support.])
-                    enable_python="no"
-                    not_found="$not_found python"
-                fi
+                PYTHON_LFLAGS=`pkg-config python2 --libs`
             else
                 AC_MSG_WARN([
 *** Python header files couldn't be found on your system.


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

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


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

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

 class AdHocDialog(Dialog2):


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

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

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

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


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

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


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

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

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


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

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

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

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

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

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

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

 	GdkPixmap *icon;

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

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

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

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

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

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

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

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

 	gdk_window_show(bm.win);

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

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

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


code:
From: Eric Bavier <bavier@member.fsf.org>
Date: Sat, 2 Apr 2016 01:31:03 -0500
Subject: [PATCH] Build against external libbrotli.

---
 Makefile         | 20 ++++----------------
 src/woff2_dec.cc |  2 +-
 src/woff2_enc.cc |  2 +-
 3 files changed, 6 insertions(+), 18 deletions(-)

diff --git a/Makefile b/Makefile
index 92b8d54..618a751 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 OS := $(shell uname)

-CPPFLAGS = -I./brotli/dec/ -I./brotli/enc/ -I./src
+CPPFLAGS := -I./src $(shell pkg-config --cflags libbrotlienc libbrotlidec)

 CC ?= gcc
 CXX ?= g++
@@ -22,29 +22,17 @@ OUROBJ = font.o glyph.o normalize.o table_tags.o transform.o \
          woff2_dec.o woff2_enc.o woff2_common.o woff2_out.o \
          variable_length.o

-BROTLI = brotli
-ENCOBJ = $(BROTLI)/enc/*.o
-DECOBJ = $(BROTLI)/dec/*.o
+BROTLI_LIBS := $(shell pkg-config --libs libbrotlienc libbrotlidec)

 OBJS = $(patsubst %, $(SRCDIR)/%, $(OUROBJ))
 EXECUTABLES=woff2_compress woff2_decompress

 EXE_OBJS=$(patsubst %, $(SRCDIR)/%.o, $(EXECUTABLES))

-ifeq (,$(wildcard $(BROTLI)/*))
-  $(error Brotli dependency not found : you must initialize the Git submodule)
-endif
-
 all : $(OBJS) $(EXECUTABLES)

-$(EXECUTABLES) : $(EXE_OBJS) deps
-	$(CXX) $(LFLAGS) $(OBJS) $(ENCOBJ) $(DECOBJ) $(SRCDIR)/$@.o -o $@
-
-deps :
-	$(MAKE) -C $(BROTLI)/dec
-	$(MAKE) -C $(BROTLI)/enc
+$(EXECUTABLES) : $(EXE_OBJS) $(OBJS)
+	$(CXX) $(LDFLAGS) $(OBJS) $(SRCDIR)/$@.o -o $@ $(BROTLI_LIBS) $(LIBS)

 clean :
 	rm -f $(OBJS) $(EXE_OBJS) $(EXECUTABLES)
-	$(MAKE) -C $(BROTLI)/dec clean
-	$(MAKE) -C $(BROTLI)/enc clean
diff --git a/src/woff2_dec.cc b/src/woff2_dec.cc
index 837eede..98c01ce 100644
--- a/src/woff2_dec.cc
+++ b/src/woff2_dec.cc
@@ -27,7 +27,7 @@
 #include <memory>
 #include <utility>

-#include "./decode.h"
+#include "brotli/dec/decode.h"
 #include "./buffer.h"
 #include "./port.h"
 #include "./round.h"
diff --git a/src/woff2_enc.cc b/src/woff2_enc.cc
index 920c614..00d74da 100644
--- a/src/woff2_enc.cc
+++ b/src/woff2_enc.cc
@@ -23,7 +23,7 @@
 #include <string>
 #include <vector>

-#include "./encode.h"
+#include "brotli/enc/encode.h"
 #include "./buffer.h"
 #include "./font.h"
 #include "./normalize.h"
--
2.7.3


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

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