code:
Downloaded from https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/missing-includes.patch?revision=7984&view=co

Status: in upstream CVS

--- a/kodilib/src/handler/KPickable.h
+++ b/kodilib/src/handler/KPickable.h
@@ -8,6 +8,7 @@

 #include "KIntrospection.h"
 #include <vector>
+#include <limits.h>

 #define DEBUG_PICKING		false

--- a/kodilib/src/tools/KIntrospection.h
+++ b/kodilib/src/tools/KIntrospection.h
@@ -11,6 +11,7 @@
 #endif

 #include <string>
+#include <string.h>

 // --------------------------------------------------------------------------------------------------------
 class KClassInfo
--- a/kodilib/src/tools/KStringTools.cpp
+++ b/kodilib/src/tools/KStringTools.cpp
@@ -6,7 +6,7 @@
 #include "KStringTools.h"
 #include "KVector.h"

-#include <sys/types.h> 	// INT_MAX
+#include <limits.h> // INT_MAX
 #include <stdio.h>

 // --------------------------------------------------------------------------------------------------------
--- a/kodilib/src/tools/KStringTools.h
+++ b/kodilib/src/tools/KStringTools.h
@@ -9,6 +9,7 @@
 #include <string>
 #include <vector>
 #include <stdarg.h>
+#include <string.h>

 // --------------------------------------------------------------------------------------------------------

--- a/kodilib/src/tools/KXMLTools.cpp
+++ b/kodilib/src/tools/KXMLTools.cpp
@@ -7,6 +7,7 @@
 #include "KConsole.h"
 #include "KSeparatedMatrix.h"
 #include <stdio.h>
+#include <stdlib.h>

 // --------------------------------------------------------------------------------------------------------
 std::string kXMLTag ( const std::string & name, const std::string & attributes, int depth )


code:
This patch was downloaded from Debian:
https://anonscm.debian.org/viewvc/pkg-games/packages/trunk/kiki-the-nano-bot/debian/patches/portability-64bit.patch?revision=7984&view=co

Make 64-bit clean (string positions don't fit in an int on 64-bit machines)

Peter De Wachter (pdewacht@gmail.com)
placed in the public domain

Status: in upstream CVS

--- a/kodilib/src/tools/KFileTools.cpp
+++ b/kodilib/src/tools/KFileTools.cpp
@@ -214,8 +214,8 @@
 // --------------------------------------------------------------------------------------------------------
 string kFileSuffix ( const string & path )
 {
-    unsigned int lastDotPos = path.rfind(".");
-    unsigned int lastSlashPos = path.rfind(kPathSep);
+    std::string::size_type lastDotPos = path.rfind(".");
+    std::string::size_type lastSlashPos = path.rfind(kPathSep);

     if (lastDotPos < path.size() - 1 && (lastDotPos > lastSlashPos || lastSlashPos == string::npos))
     {
@@ -228,7 +228,7 @@
 string kFileDirName ( const string & path )
 {
 	string native = kFileNativePath(path);
-    unsigned int lastSlashPos = native.rfind(kPathSep);
+    std::string::size_type lastSlashPos = native.rfind(kPathSep);
     if (lastSlashPos < native.size())
     {
         return native.substr(0, lastSlashPos+1);
@@ -241,7 +241,7 @@
 {
 	string native = kFileNativePath(path);
     string baseName = native;
-    unsigned int lastSlashPos = native.rfind(kPathSep);
+    std::string::size_type lastSlashPos = native.rfind(kPathSep);
     if (lastSlashPos < native.size() - 1)
     {
         baseName = native.substr(lastSlashPos+1);
--- a/kodilib/src/tools/KKeyTools.cpp
+++ b/kodilib/src/tools/KKeyTools.cpp
@@ -170,7 +170,7 @@
 // --------------------------------------------------------------------------------------------------------
 int kKeyGetDisplayWidthForKey ( const std::string & keyName )
 {
-    unsigned int keyPos = keyName.find('_', 0);
+    std::string::size_type keyPos = keyName.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return kKeyGetDisplayWidthForPureKey(keyName) + KDL_MOD_KEY_SPACING;
@@ -313,7 +313,7 @@
 int kKeyDisplayKey ( const std::string & keyName, const KPosition & pos )
 {
     KPosition start = pos;
-    unsigned int keyPos = keyName.find('_', 0);
+    std::string::size_type keyPos = keyName.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return start.x + kKeyDisplayPureKey(keyName, start) + KDL_MOD_KEY_SPACING;
@@ -380,7 +380,7 @@
 // --------------------------------------------------------------------------------------------------------
 SDL_keysym kKeyGetKeysymForKeyName ( const std::string & keyName )
 {
-    unsigned int pos = keyName.find('_');
+    std::string::size_type pos = keyName.find('_');

     std::string modString;
     std::string symString = keyName;
--- a/kodilib/src/tools/KStringTools.cpp
+++ b/kodilib/src/tools/KStringTools.cpp
@@ -13,7 +13,7 @@
 void kStringInsertStringBehindTags ( std::string & str, const std::string & insertString,
                                      const std::string & tag )
 {
-    unsigned int oldPos = 0;
+    std::string::size_type oldPos = 0;
     while ((oldPos = str.find(tag, oldPos)) != std::string::npos)
     {
         oldPos += tag.size();
@@ -34,8 +34,8 @@
 {
     std::vector<std::string> components;

-    unsigned int dividerLength = divider.size();
-    unsigned int oldpos = 0, pos;
+    std::string::size_type dividerLength = divider.size();
+    std::string::size_type oldpos = 0, pos;

     while ((pos = str.find(divider, oldpos)) != std::string::npos)
     {
@@ -50,7 +50,7 @@
 // --------------------------------------------------------------------------------------------------------
 void kStringReplace ( std::string & str, const std::string & toReplace, const std::string & replacement )
 {
-    unsigned int pos = 0, chars = toReplace.size();
+    std::string::size_type pos = 0, chars = toReplace.size();
     while ((pos = str.find(toReplace, pos)) != std::string::npos)
     {
         str.replace(pos, chars, replacement);
@@ -60,11 +60,11 @@
 // --------------------------------------------------------------------------------------------------------
 void kStringReplaceTabs ( std::string & str, unsigned int tabWidth )
 {
-    unsigned int tabPos;
+    std::string::size_type tabPos;
     while ((tabPos = str.find('\t')) != std::string::npos)
     {
-        unsigned int lastNewlinePos = str.rfind('\n', tabPos-1);
-        unsigned int relPos = (lastNewlinePos == std::string::npos) ? tabPos : tabPos - lastNewlinePos;
+        std::string::size_type lastNewlinePos = str.rfind('\n', tabPos-1);
+        std::string::size_type relPos = (lastNewlinePos == std::string::npos) ? tabPos : tabPos - lastNewlinePos;
         str.replace(tabPos, 1, std::string(tabWidth-(relPos % tabWidth), ' '));
     }
 }
@@ -114,7 +114,7 @@
 // --------------------------------------------------------------------------------------------------------
 unsigned int kStringNthCharPos ( const std::string & str, unsigned int n, char c )
 {
-    unsigned int loc = n, oloc = 0;
+    std::string::size_type loc = n, oloc = 0;
     while (n > 0 && (loc = str.find(c, oloc)) != std::string::npos)
     {
         n--;
@@ -138,7 +138,7 @@
 // --------------------------------------------------------------------------------------------------------
 void kStringCropCols ( std::string & str, unsigned int columns )
 {
-    unsigned int oloc = 0, nloc = 0;
+    std::string::size_type oloc = 0, nloc = 0;
     while ((nloc = str.find('\n', oloc)) != std::string::npos)
     {
         if ((nloc - oloc) > columns)
@@ -160,10 +160,10 @@
 unsigned int kStringCols ( const std::string & str )
 {
     if (str.size() == 0) return 0;
-    int oloc = 0, nloc;
+    long oloc = 0, nloc;
     std::string substring;
     int maxlength = 0, length;
-    while ((nloc = str.find('\n', oloc)) != (int)std::string::npos)
+    while ((nloc = str.find('\n', oloc)) != (long)std::string::npos)
     {
         substring = str.substr(oloc, nloc - oloc);
         length = substring.size();
@@ -181,7 +181,7 @@
 unsigned int kStringRows ( const std::string & str )
 {
     if (str.size() == 0) return 1;
-    unsigned int loc = 0, lines = 0;
+    std::string::size_type loc = 0, lines = 0;
     while ((loc = str.find('\n', loc)) != std::string::npos) { lines++; loc++; }
     if (str[str.size()-1] == '\n') return lines;
     return lines+1;
@@ -204,8 +204,8 @@
 {
     static char str[256];
     std::string format(fmt), subformat, text;
-    unsigned int oloc = 0;
-    unsigned int nloc = 0;
+    std::string::size_type oloc = 0;
+    std::string::size_type nloc = 0;

     kStringReplaceTabs(format);

@@ -260,7 +260,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kStringHasSuffix ( const std::string & str, const std::string & suffix )
 {
-    unsigned int result = str.rfind(suffix);
+    std::string::size_type result = str.rfind(suffix);
     if (result == std::string::npos) return false;
     return (result == str.size()-suffix.size());
 }
--- a/kodilib/src/tools/KXMLTools.cpp
+++ b/kodilib/src/tools/KXMLTools.cpp
@@ -58,11 +58,11 @@
 std::string kXMLParseToTagsInVector ( std::string & xml, const std::vector<std::string> & tags )
 {
     std::string open("<");
-    unsigned int minLoc = std::string::npos;
+    std::string::size_type minLoc = std::string::npos;
     std::vector<std::string>::const_iterator iter = tags.begin();
     while (iter != tags.end())
     {
-        unsigned int loc = xml.find(open+(*iter));
+        std::string::size_type loc = xml.find(open+(*iter));
         if (loc < minLoc) minLoc = loc;
         iter++;
     }
@@ -77,7 +77,7 @@
     std::string value;
     std::string nameStr(name);
     nameStr += "='";
-    unsigned int loc = xml.find(nameStr);
+    std::string::size_type loc = xml.find(nameStr);
     if (loc != std::string::npos)
     {
         loc += nameStr.size();
@@ -90,7 +90,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLParseNamedCloseTag ( std::string & xml, const std::string & name, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos)
     {
         if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing close tag '%s'",
@@ -117,7 +117,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLReadNamedOpenTag ( const std::string & xml, const std::string & name, std::string * attributes )
 {
-    unsigned int loc = xml.find('<'), endloc;
+    std::string::size_type loc = xml.find('<'), endloc;

     if (loc == std::string::npos || xml[loc+1] == '/') return false;

@@ -140,7 +140,7 @@
 // --------------------------------------------------------------------------------------------------------
 std::string kXMLParseNamedOpenTag ( std::string & xml, const std::string & name, std::string * attributes, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos || xml[loc+1] == '/')
     {
         if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing tag '%s'", name.c_str()));
@@ -191,7 +191,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLParseOpenTag ( std::string & xml, std::string & name, std::string * attributes, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos || xml[loc+1] == '/')
     {
         if (printError) KConsole::printError("invalid XML:\nmissing open tag");
@@ -295,7 +295,7 @@
 // --------------------------------------------------------------------------------------------------------
 bool kXMLParseValue( std::string & xml, const std::string & name, int type, void * value, bool printError )
 {
-    unsigned int loc = xml.find('<');
+    std::string::size_type loc = xml.find('<');
     if (loc == std::string::npos || xml[loc+1] == '/')
     {
         if (printError) KConsole::printError(kStringPrintf("invalid XML:\nmissing value '%s'", name.c_str()));
@@ -379,8 +379,8 @@
         }
         else if (typeString == "string")
         {
-            unsigned int first = substring.find("\"")+1;
-            unsigned int last  = substring.rfind("\"", std::string::npos);
+            std::string::size_type first = substring.find("\"")+1;
+            std::string::size_type last  = substring.rfind("\"", std::string::npos);
             *((std::string*)value) = substring.substr(first, last-first);
         }

--- a/kodilib/src/types/KKey.cpp
+++ b/kodilib/src/types/KKey.cpp
@@ -31,7 +31,7 @@
 // --------------------------------------------------------------------------------------------------------
 std::string KKey::getUnmodifiedName () const
 {
-    unsigned int keyPos = name.find('_', 0);
+    std::string::size_type keyPos = name.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return name;
@@ -42,7 +42,7 @@
 // --------------------------------------------------------------------------------------------------------
 std::string KKey::getModifierName () const
 {
-    unsigned int keyPos = name.find('_', 0);
+    std::string::size_type keyPos = name.find('_', 0);
     if (keyPos == std::string::npos)
     {
         return "";
--- a/kodilib/src/widgets/KFileNameField.cpp
+++ b/kodilib/src/widgets/KFileNameField.cpp
@@ -41,7 +41,7 @@
         std::string restPath; 				 // path behind cursor

         // map cropped path to current directory and rest path to file prefix
-        unsigned int lastSlashPos = croppedPath.rfind("/");
+        std::string::size_type lastSlashPos = croppedPath.rfind("/");
         if (lastSlashPos < croppedPath.size()-1)
         {
             restPath = croppedPath.substr(lastSlashPos+1);
@@ -88,7 +88,7 @@
         }

         // ............................collect list of entries in searchDir that match prefix restPath
-        unsigned int restLength = restPath.size();
+        std::string::size_type restLength = restPath.size();
         std::vector<std::string> matchingEntries;
         std::vector<std::string>::iterator iter = dir_entries.begin();
         while (iter != dir_entries.end())
@@ -223,7 +223,7 @@
 // --------------------------------------------------------------------------------------------------------
 void KFileNameField::selectLastPathComponent ()
 {
-    unsigned int lastSlashPos = text.rfind("/");
+    std::string::size_type lastSlashPos = text.rfind("/");
     if (lastSlashPos == text.size()-1) lastSlashPos = text.rfind("/", lastSlashPos-1);
     if (lastSlashPos < text.size()) cursor_pos = lastSlashPos+1;
     else cursor_pos = 0;
--- a/src/gui/KikiMenu.cpp
+++ b/src/gui/KikiMenu.cpp
@@ -54,7 +54,7 @@
 {
     std::string item_text (itemText);
     std::string event_name (itemText);
-    unsigned int pos;
+    std::string::size_type pos;
     float scale_factor = 1.0;

     KikiMenuItem * menu_item = new KikiMenuItem ();
--- a/src/gui/KikiTextLine.cpp
+++ b/src/gui/KikiTextLine.cpp
@@ -46,7 +46,7 @@
 void KikiTextLine::setText ( const std::string & str )
 {
     text = str;
-    unsigned int pos;
+    std::string::size_type pos;

     if ((pos = text.find ("$scale(")) != std::string::npos)
     {

license: mit


code:
This patch changes libkmod so it honors the 'LINUX_MODULE_DIRECTORY'
environment variable, rather than looking for modules exclusively in
/lib/modules.

Patch by Shea Levy and Eelco Dolstra, from Nixpkgs; adjusted to
use 'LINUX_MODULE_DIRECTORY' rather than 'MODULE_DIR' as the variable
name.

--- kmod-7/libkmod/libkmod.c	2012-03-15 08:19:16.750010226 -0400
+++ kmod-7/libkmod/libkmod.c	2012-04-04 15:21:29.532074313 -0400
@@ -200,7 +200,7 @@
 static char *get_kernel_release(const char *dirname)
 {
 	struct utsname u;
-	char *p;
+	char *p, *dirname_prefix;

 	if (dirname != NULL)
 		return path_make_absolute_cwd(dirname);
@@ -208,7 +208,10 @@
 	if (uname(&u) < 0)
 		return NULL;

-	if (asprintf(&p, "%s/%s", dirname_default_prefix, u.release) < 0)
+	if ((dirname_prefix = getenv("LINUX_MODULE_DIRECTORY")) == NULL)
+		dirname_prefix = dirname_default_prefix;
+
+	if (asprintf(&p, "%s/%s", dirname_prefix, u.release) < 0)
 		return NULL;

 	return p;

--- kmod-17/tools/static-nodes.c	2013-12-17 22:05:42.159047316 +0100
+++ kmod-17/tools/static-nodes.c	2014-04-17 13:51:17.945974320 +0200
@@ -159,6 +159,7 @@
 	FILE *in = NULL, *out = NULL;
 	const struct static_nodes_format *format = &static_nodes_format_human;
 	int r, ret = EXIT_SUCCESS;
+	char *dirname_prefix;

 	for (;;) {
 		int c, idx = 0, valid;
@@ -211,16 +212,19 @@
 		goto finish;
 	}

-	snprintf(modules, sizeof(modules), "/lib/modules/%s/modules.devname", kernel.release);
+	if ((dirname_prefix = getenv("LINUX_MODULE_DIRECTORY")) == NULL)
+		dirname_prefix = "/lib/modules";
+
+	snprintf(modules, sizeof(modules), "%s/%s/modules.devname", dirname_prefix, kernel.release);
 	in = fopen(modules, "re");
 	if (in == NULL) {
 		if (errno == ENOENT) {
-			fprintf(stderr, "Warning: /lib/modules/%s/modules.devname not found - ignoring\n",
-				kernel.release);
+			fprintf(stderr, "Warning: %s/%s/modules.devname not found - ignoring\n",
+				dirname_prefix, kernel.release);
 			ret = EXIT_SUCCESS;
 		} else {
-			fprintf(stderr, "Error: could not open /lib/modules/%s/modules.devname - %m\n",
-				kernel.release);
+			fprintf(stderr, "Error: could not open %s/%s/modules.devname - %m\n",
+				dirname_prefix, kernel.release);
 			ret = EXIT_FAILURE;
 		}
 		goto finish;


code:
Description: Avoid compilation error with gcc-4.4.
 "const char* -> char*" conversion is fatal in that version
Origin: vendor, https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
Bug-Ubuntu: https://bugs.launchpad.net/ubuntu/+source/kobodeluxe/+bug/461373
Bug-Debian: http://bugs.debian.org/552548
Forwarded: http://www.freelists.org/post/olofsonprojects/kobodlpatch-compile-error-in-windowcpp-with-g44
--- a/graphics/window.cpp
+++ b/graphics/window.cpp
@@ -398,7 +398,7 @@ void window_t::center_token_fxp(int _x,
 		 */
 		if(token)
 		{
-			char *tok = strchr(txt, token);
+			const char *tok = strchr(txt, token);
 			if(tok)
 				tokpos = tok-txt;
 			else


code:
# Authhor: Damyan Ivanov <dmn@debian.org>
# Description: rename pipe2 symbol to pipe2_kbdl to avoid clashes with the one
#              declared in system unistd.h
# Debian-Bug: 527705
# Upstream-Report: http://www.freelists.org/post/olofsonprojects/kobodeluxe-failing-to-build-in-Debian-enemiesh75-error-const-enemy-kind-pipe2-redeclared-as-different-kind-of-symbol
--- a/enemies.h
+++ b/enemies.h
@@ -72,7 +72,7 @@ extern const enemy_kind bombdeto;
 extern const enemy_kind cannon;
 extern const enemy_kind pipe1;
 extern const enemy_kind core;
-extern const enemy_kind pipe2;
+extern const enemy_kind pipe2_kbdl;
 extern const enemy_kind rock;
 extern const enemy_kind ring;
 extern const enemy_kind enemy_m1;
@@ -430,7 +430,7 @@ inline int _enemy::realize()

 inline int _enemy::is_pipe()
 {
-	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2)));
+	return ((_state != notuse) && ((ek == &pipe1) || (ek == &pipe2_kbdl)));
 }

--- a/enemy.cpp
+++ b/enemy.cpp
@@ -755,10 +755,10 @@ void _enemy::move_core()

 void _enemy::kill_core()
 {
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
-	enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+	enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
 	enemies.make(&explosion4, CS2PIXEL(x), CS2PIXEL(y));
 	sound.g_base_core_explo(x, y);
 	release();
@@ -978,19 +978,19 @@ void _enemy::move_pipe2()
 	}
 	p ^= a;
 	if(p & U_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 1);
 	if(p & R_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 3);
 	if(p & D_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 5);
 	if(p & L_MASK)
-		enemies.make(&pipe2, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
+		enemies.make(&pipe2_kbdl, CS2PIXEL(x), CS2PIXEL(y), 0, 0, 7);
 	manage.add_score(10);
 	release();
 }

-const enemy_kind pipe2 = {
+const enemy_kind pipe2_kbdl = {
 	0,
 	&_enemy::make_pipe2,
 	&_enemy::move_pipe2,


code:
# This was created in responce to Debian bug #163979
# Thing is, if you want to compant "-1" with a char value,
# you better make that char signed
--- kobodeluxe-0.5.1.orig/graphics/window.cpp
+++ kobodeluxe-0.5.1/graphics/window.cpp
@@ -331,7 +331,7 @@
 }

-void window_t::center_token(int _x, int _y, const char *txt, char token)
+void window_t::center_token(int _x, int _y, const char *txt, signed char token)
 {
 	center_token_fxp(PIXEL2CS(_x), PIXEL2CS(_y), txt, token);
 }
@@ -374,7 +374,7 @@
 }

-void window_t::center_token_fxp(int _x, int _y, const char *txt, char token)
+void window_t::center_token_fxp(int _x, int _y, const char *txt, signed char token)
 {
 	_x = CS2PIXEL((_x * xs + 128) >> 8);
 	_y = CS2PIXEL((_y * ys + 128) >> 8);
--- kobodeluxe-0.5.1.orig/graphics/window.h
+++ kobodeluxe-0.5.1/graphics/window.h
@@ -265,10 +265,10 @@
 	void font(int fnt);
 	void string(int _x, int _y, const char *txt);
 	void center(int _y, const char *txt);
-	void center_token(int _x, int _y, const char *txt, char token = 0);
+	void center_token(int _x, int _y, const char *txt, signed char token = 0);
 	void string_fxp(int _x, int _y, const char *txt);
 	void center_fxp(int _y, const char *txt);
-	void center_token_fxp(int _x, int _y, const char *txt, char token = 0);
+	void center_token_fxp(int _x, int _y, const char *txt, signed char token = 0);
 	int textwidth(const char *txt, int min = 0, int max = 255);
 	int textwidth_fxp(const char *txt, int min = 0, int max = 255);
 	int fontheight();


code:
# Author: Damyan Ivanov <dmn@debian.org>
# Description: convert a hyphen in kobodl manpage to a minus, which is what is
#              inttented here
# Upstream-Report: http://www.freelists.org/post/olofsonprojects/patch-manpage-uses-hyphen-instead-of-a-minus-sign
--- a/kobodl.6
+++ b/kobodl.6
@@ -176,7 +176,7 @@ Video Mode. Default: 17200.
 Enable Vertical Sync. Default: On.
 .TP
 .B \-videopages
-Number of Video Pages. Default: -1.
+Number of Video Pages. Default: \-1.
 .TP
 .B \-scalemode
 Scaling Filter Mode. Default: 1.


code:
From: Emile CARRY <emile.carry@sequanux.org>
Date: Wed, 6 Apr 2016 00:27:17 +0200
Subject: midicon segmentation fault

Debian-Bug: https://bugs.debian.org/819897
Forwarded: no
---
 sound/a_midicon.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sound/a_midicon.c b/sound/a_midicon.c
index 57de3cf..ded2988 100644
--- a/sound/a_midicon.c
+++ b/sound/a_midicon.c
@@ -120,8 +120,8 @@ static inline void __press(unsigned ch, unsigned key)
 {
 	m[ch].next[key] = -1;
 	m[ch].prev[key] = m[ch].last;
-	m[ch].next[m[ch].last] = (char)key;
 	m[ch].last = (char)key;
+	m[ch].next[m[ch].last] = (char)key;
 }


code:
# Patch snarfed from
# http://http.debian.net/debian/pool/main/k/kobodeluxe/kobodeluxe_0.5.1-8.debian.tar.xz
#
# Disable reading of configs, graphics, and data from the current directory.
# So it's safe to run kobodeluxe from anywhere w/o worry about an attacker
# feeding it bad data.
--- kobodeluxe-0.5.1.orig/kobo.cpp
+++ kobodeluxe-0.5.1/kobo.cpp
@@ -141,21 +141,21 @@
 	 * Graphics data
 	 */
 	/* Current dir; from within the build tree */
-	fmap->addpath("GFX", "./data/gfx");
+	//fmap->addpath("GFX", "./data/gfx");
 	/* Real data dir */
 	fmap->addpath("GFX", "DATA>>gfx");
 	/* Current dir */
-	fmap->addpath("GFX", "./gfx");
+	//fmap->addpath("GFX", "./gfx");

 	/*
 	 * Sound data
 	 */
 	/* Current dir; from within the build tree */
-	fmap->addpath("SFX", "./data/sfx");
+	//fmap->addpath("SFX", "./data/sfx");
 	/* Real data dir */
 	fmap->addpath("SFX", "DATA>>sfx");
 	/* Current dir */
-	fmap->addpath("SFX", "./sfx");
+	//fmap->addpath("SFX", "./sfx");

 	/*
 	 * Score files (user and global)
@@ -173,7 +173,7 @@
 	/* System local */
 	fmap->addpath("CONFIG", SYSCONF_DIR);
 	/* In current dir (last resort) */
-	fmap->addpath("CONFIG", "./");
+	//fmap->addpath("CONFIG", "./");
 }


code:
From e9896b8951f9faf1f76a3b45be6e70d0aeb30a73 Mon Sep 17 00:00:00 2001
From: Jan Nieuwenhuizen <janneke@gnu.org>
Date: Sat, 15 Nov 2014 17:48:18 +0100
Subject: [PATCH] Add make install.

---
 Makefile | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Makefile b/Makefile
index ca18c1e..65af31b 100644
--- a/Makefile	2016-02-09 21:34:01.883660009 +0100
+++ b/Makefile	2016-02-09 21:34:30.672150679 +0100
@@ -19,3 +19,11 @@
 	@git archive --prefix="$(PROJECT_ARCHIVE)/" HEAD \
 		 | gzip >_dist/"$(PROJECT_ARCHIVE)".tar.gz
 	@echo archive stored in "_dist/$(PROJECT_ARCHIVE).tar.gz"
+
+PREFIX=/usr/local
+install:
+	strip laby
+	mkdir -p $(PREFIX)/bin
+	cp laby $(PREFIX)/bin/laby
+	mkdir -p $(PREFIX)/share/laby
+	tar -C data -cf - . | tar -C $(PREFIX)/share/laby -xf-


code:
This patch fixes a failing unit test by feeding buildNormalizedPath to the
tzdata properly.  Three other tests are disabled, one assumes /root and the
two others use networking.  Not bad out of almost 700 tests!

by Pjotr Prins <pjotr.guix@thebird.nl>

--- a/std/datetime.d.orig      2016-11-24 01:13:52.584495545 +0100
+++ b/std/datetime.d   2016-11-24 01:17:09.655306728 +0100
@@ -28081,22 +28081,24 @@
         import std.range : retro;
         import std.format : format;

-        name = strip(name);
-
         enforce(tzDatabaseDir.exists(), new DateTimeException(format("Directory %s does not exist.", tzDatabaseDir)));
         enforce(tzDatabaseDir.isDir, new DateTimeException(format("%s is not a directory.", tzDatabaseDir)));

         version(Android)
         {
+            name = strip(name);
             auto tzfileOffset = name in tzdataIndex(tzDatabaseDir);
             enforce(tzfileOffset, new DateTimeException(format("The time zone %s is not listed.", name)));
             string tzFilename = separate_index ? "zoneinfo.dat" : "tzdata";
             immutable file = buildNormalizedPath(tzDatabaseDir, tzFilename);
         }
         else
-            immutable file = buildNormalizedPath(tzDatabaseDir, name);
+        {
+            auto filename = "./" ~ strip(name); // make sure the prefix is not stripped
+            immutable file = buildNormalizedPath(tzDatabaseDir, filename);
+        }

-        enforce(file.exists(), new DateTimeException(format("File %s does not exist.", file)));
+        enforce(file.exists(), new DateTimeException(format("File %s does not exist in %s.", file, tzDatabaseDir)));
         enforce(file.isFile, new DateTimeException(format("%s is not a file.", file)));

         auto tzFile = File(file);
diff --git a/std/path.d b/std/path.d
index 254d8f0..b0fc04d 100644
--- a/std/path.d
+++ b/std/path.d
@@ -3080,8 +3080,11 @@ unittest
         }
         else
         {
+            pragma(msg, "test disabled on GNU Guix");
+/*
             assert(expandTilde("~root") == "/root", expandTilde("~root"));
             assert(expandTilde("~root/") == "/root/", expandTilde("~root/"));
+*/
         }
         assert(expandTilde("~Idontexist/hey") == "~Idontexist/hey");
     }
diff --git a/std/socket.d b/std/socket.d
index b85d1c9..7fbf346 100644
--- a/std/socket.d
+++ b/std/socket.d
@@ -859,6 +862,8 @@ class InternetHost

 unittest
 {
+    pragma(msg, "test disabled on GNU Guix");
+    /*
     InternetHost ih = new InternetHost;

     ih.getHostByAddr(0x7F_00_00_01);
@@ -889,6 +894,7 @@ unittest
         //      writefln("aliases[%d] = %s", i, s);
         // }
     });
+    */
 }


code:
diff --git a/std/socket.d b/std/socket.d
index 111cd17..6d23da9 100644
--- a/std/socket.d
+++ b/std/socket.d
@@ -448,7 +448,7 @@ class Protocol
 // Skip this test on Android because getprotobyname/number are
 // unimplemented in bionic.
 version(CRuntime_Bionic) {} else
-@safe unittest
+@safe version(hasNetwork) unittest
 {
     // import std.stdio : writefln;
     softUnittest({
@@ -770,7 +770,7 @@ class InternetHost
 }

 ///
-@safe unittest
+@safe version(hasNetwork) unittest
 {
     InternetHost ih = new InternetHost;


code:
This fixes failures of tests "BaseLine_opt-datetime-format" and
"BaseLine_opt-time-report", which were printing an unexpected trailing '*' on
the last line of output, e.g.:

  @@ -5,4 +5,4 @@
     04/05/13 12:00 PM    04/05/13 01:30 PM       1.50h    Lunch
     04/05/13 11:30 AM    04/05/13 12:00 PM       30.0m    Walk
   --------------------------------------------------
  -
  +                                          *

Reported upstream at
https://groups.google.com/d/msg/ledger-cli/EeJUrUk8YDc/pIR-LOTVEAAJ

diff --git a/src/account.h b/src/account.h
index 1b97463d..f2555593 100644
--- a/src/account.h
+++ b/src/account.h
@@ -187,7 +187,7 @@ public:

       datetime_t         earliest_checkin;
       datetime_t         latest_checkout;
-      bool               latest_checkout_cleared;
+      bool               latest_checkout_cleared = false;

       std::set<path>     filenames;
       std::set<string>   accounts_referenced;


code:
From 01220484f428a447e9b00e071a0d85185f30e1de Mon Sep 17 00:00:00 2001
From: Alexis Hildebrandt <afh@surryhill.net>
Date: Wed, 22 Jun 2016 15:43:37 +0200
Subject: [PATCH] Revert "[python] Add fix for Boost.Python compile errors"

This reverts commit 11590e134eafa768ccc4a171cc7fb216e906095f.
---
 src/py_commodity.cc | 3 ---
 src/py_journal.cc   | 3 ---
 2 files changed, 6 deletions(-)

diff --git a/src/py_commodity.cc b/src/py_commodity.cc
index 5aafa6c..c457e64 100644
--- a/src/py_commodity.cc
+++ b/src/py_commodity.cc
@@ -243,9 +243,6 @@ namespace {

 void export_commodity()
 {
-#if BOOST_VERSION >= 106000
-  python::register_ptr_to_python< shared_ptr<commodity_pool_t> >();
-#endif
   class_< commodity_pool_t, shared_ptr<commodity_pool_t>,
           boost::noncopyable > ("CommodityPool", no_init)
     .add_property("null_commodity",
diff --git a/src/py_journal.cc b/src/py_journal.cc
index c1c38a9..879f954 100644
--- a/src/py_journal.cc
+++ b/src/py_journal.cc
@@ -232,9 +232,6 @@ void export_journal()
           boost::noncopyable >("PostHandler")
     ;

-#if BOOST_VERSION >= 106000
-  python::register_ptr_to_python< shared_ptr<collector_wrapper> >();
-#endif
   class_< collector_wrapper, shared_ptr<collector_wrapper>,
           boost::noncopyable >("PostCollectorWrapper", no_init)
     .def("__len__", &collector_wrapper::length)


code:
Copied from Debian.

Description: Disabling -prefer-non-pic which enables -fPIC
Bug-Debian: http://bugs.debian.org/401590
Author: Daniel Baumann <daniel@debian.org>, Dmitrijs Ledkovs <dmitrij.ledkov@gmail.com>

---
 liba52/configure.incl |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

Index: a52dec-deb/liba52/configure.incl
===================================================================
--- a52dec-deb.orig/liba52/configure.incl	2009-12-05 02:52:12.000000000 +0000
+++ a52dec-deb/liba52/configure.incl	2009-12-05 03:23:45.000000000 +0000
@@ -1,9 +1,6 @@
 AC_SUBST([LIBA52_CFLAGS])
 AC_SUBST([LIBA52_LIBS])

-dnl avoid -fPIC when possible
-LIBA52_CFLAGS="$LIBA52_CFLAGS -prefer-non-pic"
-
 AC_ARG_ENABLE([double],
     [  --enable-double         use double-precision samples])
 if test x"$enable_double" = x"yes"; then


code:
Copied from Debian.

Description: Explicitely link against -lm
Bug-Debian: http://bugs.debian.org/553595
Author: Fabian Greffrath <fabian@debian-unofficial.org>, Dmitrijs Ledkovs <dmitrij.ledkov@gmail.com>

---
 libao/Makefile.am |    1 +
 src/Makefile.am   |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,9 +1,9 @@
-CFLAGS = @A52DEC_CFLAGS@
+AM_CFLAGS = @A52DEC_CFLAGS@

 bin_PROGRAMS = a52dec extract_a52
 a52dec_SOURCES = a52dec.c getopt.c gettimeofday.c
 a52dec_LDADD = $(top_builddir)/liba52/liba52.la \
-	       $(top_builddir)/libao/libao.a @LIBAO_LIBS@
+	       $(top_builddir)/libao/libao.a @LIBAO_LIBS@ -lm
 extract_a52_SOURCES = extract_a52.c getopt.c

 man_MANS = a52dec.1 extract_a52.1
--- a/liba52/Makefile.am
+++ b/liba52/Makefile.am
@@ -1,4 +1,4 @@
-CFLAGS = @CFLAGS@ @LIBA52_CFLAGS@
+AM_CFLAGS = @CFLAGS@ @LIBA52_CFLAGS@

 lib_LTLIBRARIES = liba52.la


code:
Copied from Debian.

Description: Sets the soname to liba52-$(VERSION).so
Bug-Debian: http://bugs.debian.org/401636
Author: Daniel Baumann <daniel@debian.org>, Dmitrijs Ledkovs <dmitrij.ledkov@gmail.com>

---
 liba52/Makefile.am |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Index: a52dec-deb/liba52/Makefile.am
===================================================================
--- a52dec-deb.orig/liba52/Makefile.am	2009-12-05 02:52:12.000000000 +0000
+++ a52dec-deb/liba52/Makefile.am	2009-12-05 03:23:47.000000000 +0000
@@ -4,6 +4,6 @@

 liba52_la_SOURCES = bitstream.c imdct.c bit_allocate.c parse.c downmix.c
 liba52_la_LIBADD = @LIBA52_LIBS@ -lm
-liba52_la_LDFLAGS = -no-undefined
+liba52_la_LDFLAGS = -no-undefined -release @VERSION@

 EXTRA_DIST = configure.incl a52_internal.h bitstream.h tables.h


code:
Copied from Debian.

From: Rodeo
Origin: https://github.com/HandBrake/HandBrake/blob/master/contrib/a52dec/A04-modern-gcc-cflags.patch

--- a52dec-0.7.4/configure.in.orig
+++ a52dec-0.7.4/configure.in
@@ -34,11 +34,11 @@
     case "$host" in
     i?86-* | k?-*)
 	case "$host" in
-	i386-*) OPT_CFLAGS="$CFLAGS -mcpu=i386";;
-	i486-*) OPT_CFLAGS="$CFLAGS -mcpu=i486";;
-	i586-*) OPT_CFLAGS="$CFLAGS -mcpu=pentium";;
-	i686-*) OPT_CFLAGS="$CFLAGS -mcpu=pentiumpro";;
-	k6-*)   OPT_CFLAGS="$CFLAGS -mcpu=k6";;
+	i386-*) OPT_CFLAGS="$CFLAGS -mtune=i386";;
+	i486-*) OPT_CFLAGS="$CFLAGS -mtune=i486";;
+	i586-*) OPT_CFLAGS="$CFLAGS -mtune=pentium";;
+	i686-*) OPT_CFLAGS="$CFLAGS -mtune=pentiumpro";;
+	k6-*)   OPT_CFLAGS="$CFLAGS -mtune=k6";;
 	esac
 	AC_TRY_CFLAGS([$OPT_CFLAGS],[CFLAGS=$OPT_CFLAGS]);;
     sparc-* | sparc64-*)


code:
Fix CVE-2017-14166:

https://github.com/libarchive/libarchive/issues/935
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14166

Patch copied from upstream source repository:

https://github.com/libarchive/libarchive/commit/fa7438a0ff4033e4741c807394a9af6207940d71

From fa7438a0ff4033e4741c807394a9af6207940d71 Mon Sep 17 00:00:00 2001
From: Joerg Sonnenberger <joerg@bec.de>
Date: Tue, 5 Sep 2017 18:12:19 +0200
Subject: [PATCH] Do something sensible for empty strings to make fuzzers
 happy.

---
 libarchive/archive_read_support_format_xar.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/libarchive/archive_read_support_format_xar.c b/libarchive/archive_read_support_format_xar.c
index 7a22beb9d..93eeacc5e 100644
--- a/libarchive/archive_read_support_format_xar.c
+++ b/libarchive/archive_read_support_format_xar.c
@@ -1040,6 +1040,9 @@ atol10(const char *p, size_t char_cnt)
 	uint64_t l;
 	int digit;

+	if (char_cnt == 0)
+		return (0);
+
 	l = 0;
 	digit = *p - '0';
 	while (digit >= 0 && digit < 10  && char_cnt-- > 0) {
@@ -1054,7 +1057,10 @@ atol8(const char *p, size_t char_cnt)
 {
 	int64_t l;
 	int digit;
-
+
+	if (char_cnt == 0)
+		return (0);
+
 	l = 0;
 	while (char_cnt-- > 0) {
 		if (*p >= '0' && *p <= '7')


code:
Fix CVE-2017-14502:

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-14502
https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=573

Patch copied from upstream source repository:

https://github.com/libarchive/libarchive/commit/5562545b5562f6d12a4ef991fae158bf4ccf92b6

From 5562545b5562f6d12a4ef991fae158bf4ccf92b6 Mon Sep 17 00:00:00 2001
From: Joerg Sonnenberger <joerg@bec.de>
Date: Sat, 9 Sep 2017 17:47:32 +0200
Subject: [PATCH] Avoid a read off-by-one error for UTF16 names in RAR
 archives.

Reported-By: OSS-Fuzz issue 573
---
 libarchive/archive_read_support_format_rar.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libarchive/archive_read_support_format_rar.c b/libarchive/archive_read_support_format_rar.c
index cbb14c32..751de697 100644
--- a/libarchive/archive_read_support_format_rar.c
+++ b/libarchive/archive_read_support_format_rar.c
@@ -1496,7 +1496,11 @@ read_header(struct archive_read *a, struct archive_entry *entry,
         return (ARCHIVE_FATAL);
       }
       filename[filename_size++] = '\0';
-      filename[filename_size++] = '\0';
+      /*
+       * Do not increment filename_size here as the computations below
+       * add the space for the terminating NUL explicitly.
+       */
+      filename[filename_size] = '\0';

       /* Decoded unicode form is UTF-16BE, so we have to update a string
        * conversion object for it. */
--
2.15.1


code:
This patch fixes the build of adb on linux.

Copied from archlinux repository:
https://git.archlinux.org/svntogit/community.git/tree/trunk/fix_build.patch?h=packages/android-tools

diff --git a/adb/sysdeps.h b/adb/sysdeps.h
index 75dcc86..867f3ec 100644
--- a/adb/sysdeps.h
+++ b/adb/sysdeps.h
@@ -25,6 +25,7 @@
 #endif

 #include <errno.h>
+#include <sys/syscall.h>

 #include <string>
 #include <vector>
@@ -831,7 +832,16 @@ static __inline__ int adb_is_absolute_host_path(const char* path) {

 static __inline__ unsigned long adb_thread_id()
 {
-    return (unsigned long)gettid();
+  // TODO: this function should be merged with GetThreadId
+#if defined(__BIONIC__)
+  return gettid();
+#elif defined(__APPLE__)
+  return syscall(SYS_thread_selfid);
+#elif defined(__linux__)
+  return syscall(__NR_gettid);
+#elif defined(_WIN32)
+  return GetCurrentThreadId();
+#endif
 }

 #endif /* !_WIN32 */
diff --git a/base/errors_unix.cpp b/base/errors_unix.cpp
index 296995e..48269b6 100644
--- a/base/errors_unix.cpp
+++ b/base/errors_unix.cpp
@@ -17,6 +17,7 @@
 #include "android-base/errors.h"

 #include <errno.h>
+#include <string.h>

 namespace android {
 namespace base {
diff --git a/base/file.cpp b/base/file.cpp
index da1adba..91a3901 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -20,6 +20,7 @@
 #include <fcntl.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <string.h>

 #include <string>

diff --git a/base/logging.cpp b/base/logging.cpp
index 1741871..e97c7f1 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -21,6 +21,7 @@
 #include "android-base/logging.h"

 #include <libgen.h>
+#include <string.h>

 // For getprogname(3) or program_invocation_short_name.
 #if defined(__ANDROID__) || defined(__APPLE__)


code:
Patch copied from:
https://android.googlesource.com/platform/system/core/+/e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416

From e5dd71a290f664d3f3bf0dd8a4bad411dc7ad416 Mon Sep 17 00:00:00 2001
From: Elliott Hughes <enh@google.com>
Date: Thu, 28 Jul 2016 15:15:28 -0700
Subject: [PATCH] libbase should use its own logging!

Not doing so led to us using a bogus log tag.

Bug: http://b/30281203
Change-Id: I3ac91758a1a043146c65f2ae0f36fcfbe372c30f
---
 base/file.cpp    | 11 +++++------
 base/logging.cpp |  3 +--
 2 files changed, 6 insertions(+), 8 deletions(-)

diff --git a/base/file.cpp b/base/file.cpp
index da1adba19..4e7ac82d1 100644
--- a/base/file.cpp
+++ b/base/file.cpp
@@ -24,9 +24,8 @@
 #include <string>

 #include "android-base/macros.h"  // For TEMP_FAILURE_RETRY on Darwin.
+#include "android-base/logging.h"
 #include "android-base/utf8.h"
-#define LOG_TAG "base.file"
-#include "cutils/log.h"
 #include "utils/Compat.h"

 namespace android {
@@ -86,22 +85,22 @@ bool WriteStringToFile(const std::string& content, const std::string& path,
   int flags = O_WRONLY | O_CREAT | O_TRUNC | O_CLOEXEC | O_NOFOLLOW | O_BINARY;
   int fd = TEMP_FAILURE_RETRY(open(path.c_str(), flags, mode));
   if (fd == -1) {
-    ALOGE("android::WriteStringToFile open failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile open failed";
     return false;
   }

   // We do an explicit fchmod here because we assume that the caller really
   // meant what they said and doesn't want the umask-influenced mode.
   if (fchmod(fd, mode) == -1) {
-    ALOGE("android::WriteStringToFile fchmod failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile fchmod failed";
     return CleanUpAfterFailedWrite(path);
   }
   if (fchown(fd, owner, group) == -1) {
-    ALOGE("android::WriteStringToFile fchown failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile fchown failed";
     return CleanUpAfterFailedWrite(path);
   }
   if (!WriteStringToFd(content, fd)) {
-    ALOGE("android::WriteStringToFile write failed: %s", strerror(errno));
+    PLOG(ERROR) << "android::WriteStringToFile write failed";
     return CleanUpAfterFailedWrite(path);
   }
   close(fd);
diff --git a/base/logging.cpp b/base/logging.cpp
index 769c266c9..959bb8b05 100644
--- a/base/logging.cpp
+++ b/base/logging.cpp
@@ -43,12 +43,11 @@

 #include "android-base/macros.h"
 #include "android-base/strings.h"
-#include "cutils/threads.h"

 // Headers for LogMessage::LogLine.
 #ifdef __ANDROID__
 #include <android/set_abort_message.h>
-#include "cutils/log.h"
+#include "log/log.h"
 #else
 #include <sys/types.h>
 #include <unistd.h>
--
2.11.0


code:
The tests in race_empty non-deterministically fail with the error message:

  ** (process:10183): WARNING **: Async activation error activating 'IDL:Empty:1.0' : 'System exception: IDL:Bonobo/GeneralError:1.0 : Child process did not give an error message, unknown failure occurred'
FAILED 3 of 17: async activation

--- a/tests/test-activation/bonobo-activation-test.c	2014-07-01 23:45:10.830466301 -0500
+++ b/tests/test-activation/bonobo-activation-test.c	2014-07-01 23:57:53.122485584 -0500
@@ -299,7 +299,7 @@
         g_assert (ORBit_small_get_connection_status (ac) ==
                   ORBIT_CONNECTION_CONNECTED);

-        race_empty (&ev);
+        passed+=2;


code:
# We insert a hook called "@SOUND_THEME_DIRECTORY@" where, at build time, we
# insert the directory of the package "sound-theme-freedesktop" in the store.

--- src/sound-theme-spec.c.orig	2015-01-11 13:13:29.520527358 +0100
+++ src/sound-theme-spec.c	2015-01-11 14:27:23.035046849 +0100
@@ -321,9 +321,13 @@
         const char *g;

         if (!(g = getenv("XDG_DATA_DIRS")) || *g == 0)
-                return "/usr/local/share:/usr/share";
-
-        return g;
+                return "@SOUND_THEME_DIRECTORY@";
+        else {
+                const char *stp = ":@SOUND_THEME_DIRECTORY@";
+                size_t len = strlen(stp) + strlen(g) + 1;
+                char *g2 = (char*) malloc(len);
+                return strcat(strcpy(g2, g), stp);
+        }
 }

 static int load_theme_dir(ca_theme_data *t, const char *name) {


code:
Fix CVE-2017-7960:

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

Patch copied from upstream source repository:

https://git.gnome.org/browse/libcroco/commit/?id=898e3a8c8c0314d2e6b106809a8e3e93cf9d4394

From 898e3a8c8c0314d2e6b106809a8e3e93cf9d4394 Mon Sep 17 00:00:00 2001
From: Ignacio Casal Quinteiro <qignacio@amazon.com>
Date: Sun, 16 Apr 2017 13:13:43 +0200
Subject: input: check end of input before reading a byte

When reading bytes we weren't check that the index wasn't
out of bound and this could produce an invalid read which
could deal to a security bug.
---
 src/cr-input.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/cr-input.c b/src/cr-input.c
index 49000b1..3b63a88 100644
--- a/src/cr-input.c
+++ b/src/cr-input.c
@@ -256,7 +256,7 @@ cr_input_new_from_uri (const gchar * a_file_uri, enum CREncoding a_enc)
                  *we should  free buf here because it's own by CRInput.
                  *(see the last parameter of cr_input_new_from_buf().
                  */
-                buf = NULL ;
+                buf = NULL;
         }

  cleanup:
@@ -404,6 +404,8 @@ cr_input_get_nb_bytes_left (CRInput const * a_this)
 enum CRStatus
 cr_input_read_byte (CRInput * a_this, guchar * a_byte)
 {
+        gulong nb_bytes_left = 0;
+
         g_return_val_if_fail (a_this && PRIVATE (a_this)
                               && a_byte, CR_BAD_PARAM_ERROR);

@@ -413,6 +415,12 @@ cr_input_read_byte (CRInput * a_this, guchar * a_byte)
         if (PRIVATE (a_this)->end_of_input == TRUE)
                 return CR_END_OF_INPUT_ERROR;

+        nb_bytes_left = cr_input_get_nb_bytes_left (a_this);
+
+        if (nb_bytes_left < 1) {
+                return CR_END_OF_INPUT_ERROR;
+        }
+
         *a_byte = PRIVATE (a_this)->in_buf[PRIVATE (a_this)->next_byte_index];

         if (PRIVATE (a_this)->nb_bytes -
@@ -477,7 +485,6 @@ cr_input_read_char (CRInput * a_this, guint32 * a_char)
                 if (*a_char == '\n') {
                         PRIVATE (a_this)->end_of_line = TRUE;
                 }
-
         }

         return status;
--
cgit v0.12


code:
Fix CVE-2017-7961:

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

Patch copied from upstream source repository:

https://git.gnome.org/browse/libcroco/commit/?id=9ad72875e9f08e4c519ef63d44cdbd94aa9504f7

From 9ad72875e9f08e4c519ef63d44cdbd94aa9504f7 Mon Sep 17 00:00:00 2001
From: Ignacio Casal Quinteiro <qignacio@amazon.com>
Date: Sun, 16 Apr 2017 13:56:09 +0200
Subject: tknzr: support only max long rgb values

This fixes a possible out of bound when reading rgbs which
are longer than the support MAXLONG
---
 src/cr-tknzr.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/src/cr-tknzr.c b/src/cr-tknzr.c
index 1a7cfeb..1548c35 100644
--- a/src/cr-tknzr.c
+++ b/src/cr-tknzr.c
@@ -1279,6 +1279,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
         status = cr_tknzr_parse_num (a_this, &num);
         ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));

+        if (num->val > G_MAXLONG) {
+                status = CR_PARSING_ERROR;
+                goto error;
+        }
+
         red = num->val;
         cr_num_destroy (num);
         num = NULL;
@@ -1298,6 +1303,11 @@ cr_tknzr_parse_rgb (CRTknzr * a_this, CRRgb ** a_rgb)
                 status = cr_tknzr_parse_num (a_this, &num);
                 ENSURE_PARSING_COND ((status == CR_OK) && (num != NULL));

+                if (num->val > G_MAXLONG) {
+                        status = CR_PARSING_ERROR;
+                        goto error;
+                }
+
                 PEEK_BYTE (a_this, 1, &next_bytes[0]);
                 if (next_bytes[0] == '%') {
                         SKIP_CHARS (a_this, 1);
--
cgit v0.12


code:
Augment the list of expected symbols to fix the symbol-check tests on
mips64el-linux, armhf-linux and aarch64-linux.

--- libdrm-2.4.65/freedreno/freedreno-symbol-check.orig	2015-09-04 11:07:40.000000000 -0400
+++ libdrm-2.4.65/freedreno/freedreno-symbol-check	2015-10-18 23:57:15.288416229 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_FREEDRENO_H_FILES

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_freedreno.so} | awk '{print $3}'| while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 fd_bo_cpu_fini
 fd_bo_cpu_prep
 fd_bo_del
--- libdrm-2.4.65/nouveau/nouveau-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/nouveau/nouveau-symbol-check	2015-10-18 23:55:26.078327118 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_NOUVEAU_H_FILES

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_nouveau.so} | awk '{print $3}'| while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 nouveau_bo_map
 nouveau_bo_name_get
 nouveau_bo_name_ref
--- libdrm-2.4.65/libkms/kms-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/libkms/kms-symbol-check	2015-10-18 23:46:10.683869471 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBKMS_H_FILES

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libkms.so} | awk '{print $3}'| while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 kms_bo_create
 kms_bo_destroy
 kms_bo_get_prop
--- libdrm-2.4.65/intel/intel-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/intel/intel-symbol-check	2015-10-18 23:55:53.309558508 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_INTEL_H_FILES

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_intel.so} | awk '{print $3}' | while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 drm_intel_bo_alloc
 drm_intel_bo_alloc_for_render
 drm_intel_bo_alloc_tiled
--- libdrm-2.4.65/amdgpu/amdgpu-symbol-check.orig	2015-08-17 10:08:11.000000000 -0400
+++ libdrm-2.4.65/amdgpu/amdgpu-symbol-check	2015-10-18 23:56:10.606917723 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.am/libdrm_amdgpuinclude_HEADERS

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_amdgpu.so} | awk '{print $3}' | while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 amdgpu_bo_alloc
 amdgpu_bo_cpu_map
 amdgpu_bo_cpu_unmap
--- libdrm-2.4.65/exynos/exynos-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/exynos/exynos-symbol-check	2015-10-18 23:56:32.025486153 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.am/libdrm_exynos*_HEADERS

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_exynos.so} | awk '{print $3}'| while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 exynos_bo_create
 exynos_bo_destroy
 exynos_bo_from_name
--- libdrm-2.4.65/omap/omap-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/omap/omap-symbol-check	2015-10-18 23:56:44.834438626 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.am/libdrm_omap*HEADERS

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_omap.so} | awk '{print $3}'| while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 omap_bo_cpu_fini
 omap_bo_cpu_prep
 omap_bo_del
--- libdrm-2.4.65/tegra/tegra-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/tegra/tegra-symbol-check	2015-10-18 23:57:00.756759698 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first nine) are taken from tegra.h.
+# The following symbols (past the first 12) are taken from tegra.h.

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do
 ( grep -q "^$func$" || echo $func )  <<EOF
@@ -9,6 +9,9 @@
 __bss_start
 __end__
 _bss_end__
+_fbss
+_fdata
+_ftext
 _edata
 _end
 _fini
--- libdrm-2.4.65/radeon/radeon-symbol-check.orig	2015-05-04 11:47:43.000000000 -0400
+++ libdrm-2.4.65/radeon/radeon-symbol-check	2015-10-18 23:57:00.756759698 -0400
@@ -1,6 +1,6 @@
 #!/bin/bash

-# The following symbols (past the first five) are taken from the public headers.
+# The following symbols (past the first 12) are taken from the public headers.
 # A list of the latter should be available Makefile.sources/LIBDRM_RADEON_H_FILES

 FUNCS=$(nm -D --format=bsd --defined-only ${1-.libs/libdrm_tegra.so} | awk '{print $3}'| while read func; do
@@ -10,6 +10,13 @@
 _end
 _fini
 _init
+_fbss
+_fdata
+_ftext
+__bss_start__
+__bss_end__
+_bss_end__
+__end__
 radeon_bo_debug
 radeon_bo_get_handle
 radeon_bo_get_src_domain


code:
Fix CVE-2016-10195 (buffer overread in libevent's DNS code):

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10195
https://github.com/libevent/libevent/issues/317

Patch copied from upstream source repository:

https://github.com/libevent/libevent/commit/96f64a022014a208105ead6c8a7066018449d86d

From 3c570970516f48da35f42fef98276531fcc0abaa Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Mon, 1 Feb 2016 17:32:09 +0300
Subject: [PATCH] evdns: name_parse(): fix remote stack overread

---
 evdns.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/evdns.c b/evdns.c
index 60b10485..137c24ea 100644
--- a/evdns.c
+++ b/evdns.c
@@ -960,7 +960,6 @@ name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) {

 	for (;;) {
 		u8 label_len;
-		if (j >= length) return -1;
 		GET8(label_len);
 		if (!label_len) break;
 		if (label_len & 0xc0) {
@@ -981,6 +980,7 @@ name_parse(u8 *packet, int length, int *idx, char *name_out, int name_out_len) {
 			*cp++ = '.';
 		}
 		if (cp + label_len >= end) return -1;
+		if (j + label_len > length) return -1;
 		memcpy(cp, packet + j, label_len);
 		cp += label_len;
 		j += label_len;
--
2.11.0


code:
Fix CVE-2016-10196 (buffer overflow in evutil):

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10196
https://github.com/libevent/libevent/issues/318

Patch copied from upstream source repository:

https://github.com/libevent/libevent/commit/329acc18a0768c21ba22522f01a5c7f46cacc4d5

From 28bdc2f3f62259d21ccaf7be2b60ef0a53e6f342 Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Sun, 31 Jan 2016 00:57:16 +0300
Subject: [PATCH] evutil_parse_sockaddr_port(): fix buffer overflow

---
 evutil.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/evutil.c b/evutil.c
index 33445170..e2dfe6e4 100644
--- a/evutil.c
+++ b/evutil.c
@@ -1808,12 +1808,12 @@ evutil_parse_sockaddr_port(const char *ip_as_string, struct sockaddr *out, int *

 	cp = strchr(ip_as_string, ':');
 	if (*ip_as_string == '[') {
-		int len;
+		size_t len;
 		if (!(cp = strchr(ip_as_string, ']'))) {
 			return -1;
 		}
-		len = (int) ( cp-(ip_as_string + 1) );
-		if (len > (int)sizeof(buf)-1) {
+		len = ( cp-(ip_as_string + 1) );
+		if (len > sizeof(buf)-1) {
 			return -1;
 		}
 		memcpy(buf, ip_as_string+1, len);
--
2.11.0


code:
Fix CVE-2016-10197 (out of bounds read on empty hostnames in evdns):

https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-10197
https://github.com/libevent/libevent/issues/332

Patch copied from upstream source repository:

https://github.com/libevent/libevent/commit/ec65c42052d95d2c23d1d837136d1cf1d9ecef9e

From a0305cec166a5bc89f1eb362510cc4cd25ecc0bc Mon Sep 17 00:00:00 2001
From: Azat Khuzhin <a3at.mail@gmail.com>
Date: Fri, 25 Mar 2016 00:33:47 +0300
Subject: [PATCH] evdns: fix searching empty hostnames

---
 evdns.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/evdns.c b/evdns.c
index 137c24ea..6191c677 100644
--- a/evdns.c
+++ b/evdns.c
@@ -3122,9 +3122,12 @@ search_set_from_hostname(struct evdns_base *base) {
 static char *
 search_make_new(const struct search_state *const state, int n, const char *const base_name) {
 	const size_t base_len = strlen(base_name);
-	const char need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+	char need_to_append_dot;
 	struct search_domain *dom;

+	if (!base_len) return NULL;
+	need_to_append_dot = base_name[base_len - 1] == '.' ? 0 : 1;
+
 	for (dom = state->head; dom; dom = dom->next) {
 		if (!n--) {
 			/* this is the postfix we want */
--
2.11.0


code:
From a8769ef12d7e223e33fc47bed03fba2bfa2f3536 Mon Sep 17 00:00:00 2001
From: Marcus Sundberg <marcus@marcussundberg.com>
Date: Sat, 26 Mar 2016 20:11:43 +0100
Subject: [PATCH] evbuffer_add: Use last_with_datap if set, not last.

evbuffer_add() would always put data in the last chain, even if there
was available space in a previous chain, and in doing so it also
failed to update last_with_datap, causing subsequent calls to other
functions that do look at last_with_datap to add data in the middle
of the evbuffer instead of at the end.

Fixes the evbuffer_add() part of issue #335, and the evbuffer/add2 and
evbuffer/add3 tests, and also prevents wasting space available in the
chain pointed to by last_with_datap.
---
 buffer.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/buffer.c b/buffer.c
index 7cca0e8a..f378b731 100644
--- a/buffer.c
+++ b/buffer.c
@@ -1732,7 +1732,11 @@ evbuffer_add(struct evbuffer *buf, const void *data_in, size_t datlen)
 		goto done;
 	}

-	chain = buf->last;
+	if (*buf->last_with_datap == NULL) {
+		chain = buf->last;
+	} else {
+		chain = *buf->last_with_datap;
+	}

 	/* If there are no chains allocated for this buffer, allocate one
 	 * big enough to hold all the data. */
--
2.12.0


code:
Disable tests that rely on usable DNS lookups, which aren't available
in build chroots.

--- libevent-2.0.21-stable/test/regress_dns.c	2013-01-20 22:32:09.000000000 +0100
+++ libevent-2.0.21-stable/test/regress_dns.c	2013-01-20 22:32:30.000000000 +0100
@@ -2120,10 +2120,6 @@

 struct testcase_t dns_testcases[] = {
 	DNS_LEGACY(server, TT_FORK|TT_NEED_BASE),
-	DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
-	DNS_LEGACY(gethostbyname6, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
-	DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS|TT_OFF_BY_DEFAULT),
-	{ "resolve_reverse", dns_resolve_reverse, TT_FORK|TT_OFF_BY_DEFAULT, NULL, NULL },
 	{ "search_empty", dns_search_empty_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
 	{ "search", dns_search_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
 	{ "search_lower", dns_search_lower_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
@@ -2163,9 +2159,6 @@

 	{ "client_fail_requests", dns_client_fail_requests_test,
 	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
-	{ "client_fail_requests_getaddrinfo",
-	  dns_client_fail_requests_getaddrinfo_test,
-	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },

 	END_OF_TESTCASES
 };


code:
These fail on 32-bit due to an overflow bug in the test program.

See test/regress_util.c:1448.

Upstream bug URL:

https://github.com/libevent/libevent/issues/452

diff --git a/test/regress_util.c b/test/regress_util.c
index ef6a1487..4de501fc 100644
--- a/test/regress_util.c
+++ b/test/regress_util.c
@@ -1413,9 +1413,9 @@ static struct date_rfc1123_case {
 	{  1323648000, "Mon, 12 Dec 2011 00:00:00 GMT"},
 #ifndef _WIN32
 	/** In win32 case we have max   "23:59:59 January 18, 2038, UTC" for time32 */
-	{  4294967296, "Sun, 07 Feb 2106 06:28:16 GMT"} /* 2^32 */,
+	//{  4294967296, "Sun, 07 Feb 2106 06:28:16 GMT"} /* 2^32 */,
 	/** In win32 case we have max "23:59:59, December 31, 3000, UTC" for time64 */
-	{253402300799, "Fri, 31 Dec 9999 23:59:59 GMT"} /* long long future no one can imagine */,
+	//{253402300799, "Fri, 31 Dec 9999 23:59:59 GMT"} /* long long future no one can imagine */,
 	{  1456704000, "Mon, 29 Feb 2016 00:00:00 GMT"} /* leap year */,
 #endif
 	{  1435708800, "Wed, 01 Jul 2015 00:00:00 GMT"} /* leap second */,


code:
Disable tests that rely on usable DNS lookups, which aren't available
in build chroots.

--- libevent-2.0.21-stable/test/regress_dns.c	2013-01-20 22:32:09.000000000 +0100
+++ libevent-2.0.21-stable/test/regress_dns.c	2013-01-20 22:32:30.000000000 +0100
@@ -1827,10 +1827,6 @@ end:

 struct testcase_t dns_testcases[] = {
 	DNS_LEGACY(server, TT_FORK|TT_NEED_BASE),
-	DNS_LEGACY(gethostbyname, TT_FORK|TT_NEED_BASE|TT_NEED_DNS),
-	DNS_LEGACY(gethostbyname6, TT_FORK|TT_NEED_BASE|TT_NEED_DNS),
-	DNS_LEGACY(gethostbyaddr, TT_FORK|TT_NEED_BASE|TT_NEED_DNS),
-	{ "resolve_reverse", dns_resolve_reverse, TT_FORK, NULL, NULL },
 	{ "search", dns_search_test, TT_FORK|TT_NEED_BASE, &basic_setup, NULL },
 	{ "search_cancel", dns_search_cancel_test,
 	  TT_FORK|TT_NEED_BASE, &basic_setup, NULL },


code:
Fix CVE-2016-6328:

https://bugzilla.redhat.com/show_bug.cgi?id=1366239
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2016-6328

Patch copied from upstream source repository:

https://github.com/libexif/libexif/commit/41bd04234b104312f54d25822f68738ba8d7133d

From 41bd04234b104312f54d25822f68738ba8d7133d Mon Sep 17 00:00:00 2001
From: Marcus Meissner <marcus@jet.franken.de>
Date: Tue, 25 Jul 2017 23:44:44 +0200
Subject: [PATCH] fixes some (not all) buffer overreads during decoding pentax
 makernote entries.

This should fix:
https://sourceforge.net/p/libexif/bugs/125/ CVE-2016-6328
---
 libexif/pentax/mnote-pentax-entry.c | 16 +++++++++++++---
 1 file changed, 13 insertions(+), 3 deletions(-)

diff --git a/libexif/pentax/mnote-pentax-entry.c b/libexif/pentax/mnote-pentax-entry.c
index d03d159..ea0429a 100644
--- a/libexif/pentax/mnote-pentax-entry.c
+++ b/libexif/pentax/mnote-pentax-entry.c
@@ -425,24 +425,34 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry,
 		case EXIF_FORMAT_SHORT:
 		  {
 			const unsigned char *data = entry->data;
-		  	size_t k, len = strlen(val);
+		  	size_t k, len = strlen(val), sizeleft;
+
+			sizeleft = entry->size;
 		  	for(k=0; k<entry->components; k++) {
+				if (sizeleft < 2)
+					break;
 				vs = exif_get_short (data, entry->order);
 				snprintf (val+len, maxlen-len, "%i ", vs);
 				len = strlen(val);
 				data += 2;
+				sizeleft -= 2;
 			}
 		  }
 		  break;
 		case EXIF_FORMAT_LONG:
 		  {
 			const unsigned char *data = entry->data;
-		  	size_t k, len = strlen(val);
+		  	size_t k, len = strlen(val), sizeleft;
+
+			sizeleft = entry->size;
 		  	for(k=0; k<entry->components; k++) {
+				if (sizeleft < 4)
+					break;
 				vl = exif_get_long (data, entry->order);
 				snprintf (val+len, maxlen-len, "%li", (long int) vl);
 				len = strlen(val);
 				data += 4;
+				sizeleft -= 4;
 			}
 		  }
 		  break;
@@ -455,5 +465,5 @@ mnote_pentax_entry_get_value (MnotePentaxEntry *entry,
 		break;
 	}

-	return (val);
+	return val;
 }
--
2.16.0


code:
Fix CVE-2017-7544:

https://sourceforge.net/p/libexif/bugs/130/
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-7544

Patch copied from upstream bug tracker:

https://sourceforge.net/p/libexif/bugs/130/#489a

Index: libexif/exif-data.c
===================================================================
RCS file: /cvsroot/libexif/libexif/libexif/exif-data.c,v
retrieving revision 1.131
diff -u -r1.131 exif-data.c
--- a/libexif/exif-data.c	12 Jul 2012 17:28:26 -0000	1.131
+++ b/libexif/exif-data.c	25 Jul 2017 21:34:06 -0000
@@ -255,6 +255,12 @@
 			exif_mnote_data_set_offset (data->priv->md, *ds - 6);
 			exif_mnote_data_save (data->priv->md, &e->data, &e->size);
 			e->components = e->size;
+			if (exif_format_get_size (e->format) != 1) {
+				/* e->format is taken from input code,
+				 * but we need to make sure it is a 1 byte
+				 * entity due to the multiplication below. */
+				e->format = EXIF_FORMAT_UNDEFINED;
+			}
 		}
 	}


code:
The patch fixes build failure of form:
     ../src/alpha/osf.S:298:2: error: #error "osf.S out of sync with ffi.h"
Upstream fixed the bug in a more invasive way
but didn't have releases since 3.2.1.

The patch is taken from Gentoo:
https://gitweb.gentoo.org/repo/gentoo.git/tree/dev-libs/libffi/files/libffi-3.2.1-complex_alpha.patch

--- libffi-3.2.1/src/alpha/osf.S	2015-01-16 10:46:15.000000000 +0100
+++ libffi-3.2.1/src/alpha/osf.S	2015-01-16 10:46:24.000000000 +0100
@@ -279,6 +279,7 @@
 	.gprel32 $load_64	# FFI_TYPE_SINT64
 	.gprel32 $load_none	# FFI_TYPE_STRUCT
 	.gprel32 $load_64	# FFI_TYPE_POINTER
+	.gprel32 $load_none	# FFI_TYPE_COMPLEX

 /* Assert that the table above is in sync with ffi.h.  */

@@ -294,7 +295,8 @@
 	|| FFI_TYPE_SINT64 != 12	\
 	|| FFI_TYPE_STRUCT != 13	\
 	|| FFI_TYPE_POINTER != 14	\
-	|| FFI_TYPE_LAST != 14
+	|| FFI_TYPE_COMPLEX != 15       \
+	|| FFI_TYPE_LAST != 15
 #error "osf.S out of sync with ffi.h"
 #endif


code:
From c87a112246e0bcbd5c3a8aa484a50c617d710dbf Mon Sep 17 00:00:00 2001
From: Philip Withnall <philip.withnall@collabora.co.uk>
Date: Fri, 12 Dec 2014 17:31:01 +0000
Subject: [PATCH] tests: Eliminate ISO 8601 formatting workaround for dates

Follow up to commit 732017e4e5235e28c578cc3367fa0c4548b65495.

https://bugzilla.gnome.org/show_bug.cgi?id=739956
---
 gdata/tests/calendar.c | 20 ++++++++++----------
 gdata/tests/general.c  | 34 +++++++++++++++++-----------------
 gdata/tests/tasks.c    | 34 +++++++++++++++++-----------------
 gdata/tests/youtube.c  | 16 ++++++++--------
 4 files changed, 52 insertions(+), 52 deletions(-)

diff --git a/gdata/tests/calendar.c b/gdata/tests/calendar.c
index bb1d609..c54ddda 100644
--- a/gdata/tests/calendar.c
+++ b/gdata/tests/calendar.c
@@ -620,7 +620,7 @@ test_event_xml (void)
 			"<gCal:guestsCanInviteOthers value='false'/>"
 			"<gCal:guestsCanSeeGuests value='false'/>"
 			"<gCal:anyoneCanAddSelf value='false'/>"
-			"<gd:when startTime='2009-04-17T15:00:00.000001+00:00' endTime='2009-04-17T17:00:00.000001+00:00'/>"
+			"<gd:when startTime='2009-04-17T15:00:00Z' endTime='2009-04-17T17:00:00Z'/>"
 			"<gd:who email='john.smith@example.com' "
 			        "rel='http://schemas.google.com/g/2005#event.organizer' "
 			        "valueString='John Smith\342\200\275'/>"
@@ -706,7 +706,7 @@ test_event_xml_dates (void)
 			"<gCal:guestsCanSeeGuests value='false'/>"
 			"<gCal:anyoneCanAddSelf value='false'/>"
 			"<gd:when startTime='2009-04-17'/>"
-			"<gd:when startTime='2009-04-17T15:00:00.000001+00:00'/>"
+			"<gd:when startTime='2009-04-17T15:00:00Z'/>"
 			"<gd:when startTime='2009-04-27' endTime='2009-05-06'/>"
 		"</entry>");

@@ -934,25 +934,25 @@ test_query_uri (void)

 	/* Check the built query URI with a normal feed URI */
 	query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com");
-	g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00"
-	                                "&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00&singleevents=true&sortorder=descending"
-	                                "&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00&ctz=America%2FLos_Angeles&max-attendees=15"
+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00Z"
+	                                "&recurrence-expansion-end=2010-04-17T15:00:00Z&singleevents=true&sortorder=descending"
+	                                "&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z&ctz=America%2FLos_Angeles&max-attendees=15"
 	                                "&showdeleted=true");
 	g_free (query_uri);

 	/* …with a feed URI with a trailing slash */
 	query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/");
-	g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00"
-	                                "&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00&singleevents=true&sortorder=descending"
-	                                "&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00&ctz=America%2FLos_Angeles&max-attendees=15"
+	g_assert_cmpstr (query_uri, ==, "http://example.com/?q=q&futureevents=true&orderby=starttime&recurrence-expansion-start=2009-04-17T15:00:00Z"
+	                                "&recurrence-expansion-end=2010-04-17T15:00:00Z&singleevents=true&sortorder=descending"
+	                                "&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z&ctz=America%2FLos_Angeles&max-attendees=15"
 	                                "&showdeleted=true");
 	g_free (query_uri);

 	/* …with a feed URI with pre-existing arguments */
 	query_uri = gdata_query_get_query_uri (GDATA_QUERY (query), "http://example.com/bar/?test=test&this=that");
 	g_assert_cmpstr (query_uri, ==, "http://example.com/bar/?test=test&this=that&q=q&futureevents=true&orderby=starttime"
-	                                "&recurrence-expansion-start=2009-04-17T15:00:00.000001+00:00&recurrence-expansion-end=2010-04-17T15:00:00.000001+00:00"
-	                                "&singleevents=true&sortorder=descending&start-min=2009-04-17T15:00:00.000001+00:00&start-max=2010-04-17T15:00:00.000001+00:00"
+	                                "&recurrence-expansion-start=2009-04-17T15:00:00Z&recurrence-expansion-end=2010-04-17T15:00:00Z"
+	                                "&singleevents=true&sortorder=descending&start-min=2009-04-17T15:00:00Z&start-max=2010-04-17T15:00:00Z"
 	                                "&ctz=America%2FLos_Angeles&max-attendees=15&showdeleted=true");
 	g_free (query_uri);

diff --git a/gdata/tests/general.c b/gdata/tests/general.c
index 237a908..f828d2e 100644
--- a/gdata/tests/general.c
+++ b/gdata/tests/general.c
@@ -528,8 +528,8 @@ test_entry_parse_xml (void)
 			 "<?xml version='1.0' encoding='UTF-8'?>"
 			 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' xmlns:ns='http://example.com/'>"
 				"<title type='text'>Testing unhandled XML</title>"
-				"<updated>2009-01-25T14:07:37.000001+00:00</updated>"
-				"<published>2009-01-23T14:06:37.000001+00:00</published>"
+				"<updated>2009-01-25T14:07:37Z</updated>"
+				"<published>2009-01-23T14:06:37Z</published>"
 				"<content type='text'>Here we test unhandled XML elements.</content>"
 				"<foobar>Test!</foobar>"
 				"<barfoo shizzle=\"zing\"/>"
@@ -569,8 +569,8 @@ test_entry_parse_xml_kind_category (void)
 			 "<?xml version='1.0' encoding='UTF-8'?>"
 			 "<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>"
 				"<title type='text'>Testing kind categories</title>"
-				"<updated>2009-01-25T14:07:37.000001+00:00</updated>"
-				"<published>2009-01-23T14:06:37.000001+00:00</published>"
+				"<updated>2009-01-25T14:07:37Z</updated>"
+				"<published>2009-01-23T14:06:37Z</published>"
 				"<content type='text'>Here we test kind categories.</content>"
 			"<category term='http://schemas.google.com/docs/2007#file' "
 			          "scheme='http://schemas.google.com/g/2005#kind' "
@@ -620,7 +620,7 @@ test_entry_parse_json (void)
 		"{"
 			"\"title\":\"A title\","
 			"\"id\":\"some-id\","
-			"\"updated\":\"2009-01-25T14:07:37.000001+00:00\","
+			"\"updated\":\"2009-01-25T14:07:37Z\","
 			"\"etag\":\"some-etag\","
 			"\"selfLink\":\"http://example.com/\","
 			"\"kind\":\"kind#kind\","
@@ -760,8 +760,8 @@ test_entry_escaping (void)
 		"<entry xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005'>"
 			"<title type='text'>Escaped content & stuff</title>"
 			"<id>http://foo.com/?foo&bar</id>"
-			"<updated>2010-12-10T17:21:24.000001+00:00</updated>"
-			"<published>2010-12-10T17:21:24.000001+00:00</published>"
+			"<updated>2010-12-10T17:21:24Z</updated>"
+			"<published>2010-12-10T17:21:24Z</published>"
 			"<summary type='text'>Summary & stuff</summary>"
 			"<rights>Free & open source</rights>"
 			"<content type='text'>Content & things.</content>"
@@ -1106,7 +1106,7 @@ test_feed_escaping (void)
 		"<feed xmlns='http://www.w3.org/2005/Atom'>"
 			"<title type='text'>Test feed & stuff.</title>"
 			"<id>http://foo.com?foo&bar</id>"
-			"<updated>2010-12-10T17:49:15.000001+00:00</updated>"
+			"<updated>2010-12-10T17:49:15Z</updated>"
 		"</feed>");
 	g_object_unref (feed);
 }
@@ -1157,28 +1157,28 @@ test_query_dates (void)
 	/* updated-min */
 	gdata_query_set_updated_min (query, 1373280114); /* 2013-07-08T10:41:54Z */
 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
-	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54.000001+00:00");
+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-min=2013-07-08T10:41:54Z");
 	g_free (query_uri);
 	gdata_query_set_updated_min (query, -1);

 	/* updated-max */
 	gdata_query_set_updated_max (query, 1373280114); /* 2013-07-08T10:41:54Z */
 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
-	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54.000001+00:00");
+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&updated-max=2013-07-08T10:41:54Z");
 	g_free (query_uri);
 	gdata_query_set_updated_max (query, -1);

 	/* published-min */
 	gdata_query_set_published_min (query, 1373280114); /* 2013-07-08T10:41:54Z */
 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
-	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54.000001+00:00");
+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-min=2013-07-08T10:41:54Z");
 	g_free (query_uri);
 	gdata_query_set_published_min (query, -1);

 	/* published-max */
 	gdata_query_set_published_max (query, 1373280114); /* 2013-07-08T10:41:54Z */
 	query_uri = gdata_query_get_query_uri (query, "http://example.com");
-	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54.000001+00:00");
+	g_assert_cmpstr (query_uri, ==, "http://example.com?q=baz&published-max=2013-07-08T10:41:54Z");
 	g_free (query_uri);
 	gdata_query_set_published_max (query, -1);

@@ -3127,7 +3127,7 @@ test_gd_reminder (void)
 	gdata_test_assert_xml (reminder,
 			 "<?xml version='1.0' encoding='UTF-8'?>"
 			 "<gd:reminder xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' "
-				"absoluteTime='2005-06-07T00:55:00.000001+00:00' method='alert'/>");
+				"absoluteTime='2005-06-07T00:55:00Z' method='alert'/>");
 	g_object_unref (reminder);
 }

@@ -3218,8 +3218,8 @@ test_gd_when (void)
 	/* Check the outputted XML is the same */
 	gdata_test_assert_xml (when,
 			 "<?xml version='1.0' encoding='UTF-8'?>"
-			 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-07T01:00:00.000001+00:00' "
-				"endTime='2005-06-07T02:00:00.000001+00:00'/>");
+			 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-07T01:00:00Z' "
+				"endTime='2005-06-07T02:00:00Z'/>");
 	g_object_unref (when);

 	/* Now parse a time with different information */
@@ -3258,7 +3258,7 @@ test_gd_when (void)
 			 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' startTime='2005-06-06' "
 				"endTime='2005-06-08' valueString='This weekend'>"
 				"<gd:reminder minutes='15'/>"
-				"<gd:reminder absoluteTime='2005-06-06T00:00:00.000001+00:00' method='alert'/>"
+				"<gd:reminder absoluteTime='2005-06-06T00:00:00Z' method='alert'/>"
 				"<foobar/>"
 			 "</gd:when>");
 	g_object_unref (when);
@@ -3278,7 +3278,7 @@ test_gd_when_escaping (void)
 	gdata_test_assert_xml (when,
 	                 "<?xml version='1.0' encoding='UTF-8'?>"
 	                 "<gd:when xmlns='http://www.w3.org/2005/Atom' xmlns:gd='http://schemas.google.com/g/2005' "
-	                          "startTime='2005-06-07T01:00:00.000001+00:00' valueString='Value string & stuff!'/>");
+	                          "startTime='2005-06-07T01:00:00Z' valueString='Value string & stuff!'/>");
 	g_object_unref (when);
 }

diff --git a/gdata/tests/tasks.c b/gdata/tests/tasks.c
index 7a5bc7e..7bf3174 100644
--- a/gdata/tests/tasks.c
+++ b/gdata/tests/tasks.c
@@ -122,11 +122,11 @@ test_query_uri (void)
 	g_assert_cmpstr (query_uri, ==,
 	                 "http://example.com"
 	                 "?maxResults=10"
-	                 "&updatedMin=1970-01-01T01:53:09.000001+00:00"
-	                 "&completedMin=1970-01-01T01:34:38.000001+00:00"
-	                 "&completedMax=1970-01-01T00:20:34.000001+00:00"
-	                 "&dueMin=1970-01-01T00:39:05.000001+00:00"
-	                 "&dueMax=1970-01-01T00:57:36.000001+00:00"
+	                 "&updatedMin=1970-01-01T01:53:09Z"
+	                 "&completedMin=1970-01-01T01:34:38Z"
+	                 "&completedMax=1970-01-01T00:20:34Z"
+	                 "&dueMin=1970-01-01T00:39:05Z"
+	                 "&dueMax=1970-01-01T00:57:36Z"
 	                 "&showCompleted=true"
 	                 "&showDeleted=true"
 	                 "&showHidden=true");
@@ -148,11 +148,11 @@ test_query_uri (void)
 	g_assert_cmpstr (query_uri, ==,
 	                 "http://example.com"
 	                 "?maxResults=10"
-	                 "&updatedMin=1970-01-01T01:53:09.000001+00:00"
-	                 "&completedMin=1970-01-01T01:34:38.000001+00:00"
-	                 "&completedMax=1970-01-01T00:20:34.000001+00:00"
-	                 "&dueMin=1970-01-01T00:39:05.000001+00:00"
-	                 "&dueMax=1970-01-01T00:57:36.000001+00:00"
+	                 "&updatedMin=1970-01-01T01:53:09Z"
+	                 "&completedMin=1970-01-01T01:34:38Z"
+	                 "&completedMax=1970-01-01T00:20:34Z"
+	                 "&dueMin=1970-01-01T00:39:05Z"
+	                 "&dueMax=1970-01-01T00:57:36Z"
 	                 "&showCompleted=false"
 	                 "&showDeleted=false"
 	                 "&showHidden=false");
@@ -317,8 +317,8 @@ test_task_properties (void)
 			"\"title\": \"some-other-title\","
 			"\"notes\": \"more-notes\","
 			"\"status\": \"completed\","
-			"\"due\": \"2014-08-30T17:20:00.000001+00:00\","
-			"\"completed\": \"2014-08-30T17:20:00.000001+00:00\","
+			"\"due\": \"2014-08-30T17:20:00Z\","
+			"\"completed\": \"2014-08-30T17:20:00Z\","
 			"\"deleted\": true,"
 			"\"hidden\": false"
 		"}");
@@ -332,8 +332,8 @@ test_task_properties (void)
 			"\"title\": \"some-other-title\","
 			"\"notes\": \"more-notes\","
 			"\"status\": \"completed\","
-			"\"due\": \"2014-08-30T17:20:00.000001+00:00\","
-			"\"completed\": \"2014-08-30T17:20:00.000001+00:00\","
+			"\"due\": \"2014-08-30T17:20:00Z\","
+			"\"completed\": \"2014-08-30T17:20:00Z\","
 			"\"deleted\": false,"
 			"\"hidden\": false"
 		"}");
@@ -496,14 +496,14 @@ test_task_parser_normal (void)
 			"\"id\": \"some-id\","
 			"\"etag\": \"some-etag\","
 			"\"title\": \"some-title \\\"with quotes\\\"\","
-			"\"updated\": \"2014-08-30T19:40:00.000001+00:00\","
+			"\"updated\": \"2014-08-30T19:40:00Z\","
 			"\"selfLink\": \"http://some-uri/\","
 			"\"parent\": \"some-parent-id\","
 			"\"position\": \"some-position\","
 			"\"notes\": \"Some notes!\","
 			"\"status\": \"needsAction\","
-			"\"due\": \"2014-08-30T20:00:00.000001+00:00\","
-			"\"completed\": \"2014-08-30T20:10:05.000001+00:00\","
+			"\"due\": \"2014-08-30T20:00:00Z\","
+			"\"completed\": \"2014-08-30T20:10:05Z\","
 			"\"deleted\": false,"
 			"\"hidden\": true,"
 			/* Unhandled for the moment: */
diff --git a/gdata/tests/youtube.c b/gdata/tests/youtube.c
index a1e070a..1195bc3 100644
--- a/gdata/tests/youtube.c
+++ b/gdata/tests/youtube.c
@@ -967,8 +967,8 @@ test_parsing_yt_recorded (void)
 				"gd:etag='W/\"CEMFSX47eCp7ImA9WxVUGEw.\"'>"
 				"<title type='text'>Judas Priest - Painkiller</title>"
 				"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
-				"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
-				"<published>2006-05-16T14:06:37.000001+00:00</published>"
+				"<updated>2009-03-23T12:46:58Z</updated>"
+				"<published>2006-05-16T14:06:37Z</published>"
 				"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
 				"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
 				"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
@@ -1055,8 +1055,8 @@ test_parsing_yt_access_control (void)
 				"gd:etag='W/\"CEMFSX47eCp7ImA9WxVUGEw.\"'>"
 				"<title type='text'>Judas Priest - Painkiller</title>"
 				"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
-				"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
-				"<published>2006-05-16T14:06:37.000001+00:00</published>"
+				"<updated>2009-03-23T12:46:58Z</updated>"
+				"<published>2006-05-16T14:06:37Z</published>"
 				"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
 				"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
 				"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
@@ -1255,8 +1255,8 @@ test_parsing_georss_where (void)
 		       "xmlns:gml='http://www.opengis.net/gml'>"
 			"<title type='text'>Some video somewhere</title>"
 			"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
-			"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
-			"<published>2006-05-16T14:06:37.000001+00:00</published>"
+			"<updated>2009-03-23T12:46:58Z</updated>"
+			"<published>2006-05-16T14:06:37Z</published>"
 			"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
 			"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
 			"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
@@ -1295,8 +1295,8 @@ test_parsing_georss_where (void)
 		       "xmlns:gml='http://www.opengis.net/gml'>"
 			"<title type='text'>Some video somewhere</title>"
 			"<id>tag:youtube.com,2008:video:JAagedeKdcQ</id>"
-			"<updated>2009-03-23T12:46:58.000001+00:00</updated>"
-			"<published>2006-05-16T14:06:37.000001+00:00</published>"
+			"<updated>2009-03-23T12:46:58Z</updated>"
+			"<published>2006-05-16T14:06:37Z</published>"
 			"<category term='http://gdata.youtube.com/schemas/2007#video' scheme='http://schemas.google.com/g/2005#kind'/>"
 			"<link href='http://www.youtube.com/watch?v=JAagedeKdcQ' rel='http://www.iana.org/assignments/relation/alternate' type='text/html'/>"
 			"<link href='http://gdata.youtube.com/feeds/api/videos/JAagedeKdcQ?client=ytapi-google-jsdemo' rel='http://www.iana.org/assignments/relation/self' type='application/atom+xml'/>"
--
1.9.3


code:
diff -ur a/gdata/tests/oauth1-authorizer.c b/gdata/tests/oauth1-authorizer.c
--- a/gdata/tests/oauth1-authorizer.c	1969-12-31 19:00:00.000000000 -0500
+++ b/gdata/tests/oauth1-authorizer.c	2017-05-27 19:35:30.551725678 -0400
@@ -1045,10 +1045,10 @@
 	/* Sync request-authentication-uri tests */
 	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync", OAuth1AuthorizerData, NULL, set_up_oauth1_authorizer_data,
 	            test_oauth1_authorizer_request_authentication_uri_sync, tear_down_oauth1_authorizer_data);
-	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains", OAuth1AuthorizerData, NULL,
+	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains1", OAuth1AuthorizerData, NULL,
 	            set_up_oauth1_authorizer_data_multiple_domains, test_oauth1_authorizer_request_authentication_uri_sync,
 	            tear_down_oauth1_authorizer_data);
-	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains", OAuth1AuthorizerData, NULL,
+	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/multiple-domains2", OAuth1AuthorizerData, NULL,
 	            set_up_oauth1_authorizer_data_locale, test_oauth1_authorizer_request_authentication_uri_sync,
 	            tear_down_oauth1_authorizer_data);
 	g_test_add ("/oauth1-authorizer/request-authentication-uri/sync/cancellation", OAuth1AuthorizerData, NULL,


code:
The Clar test framework has a bug whereby it skips the parsing phase
on files with mtime=0.

Reported upstream at <https://github.com/vmg/clar/pull/78>.

diff --git a/tests/generate.py b/tests/generate.py
index b639c8f..111ca41 100644
--- a/tests/generate.py
+++ b/tests/generate.py
@@ -63,3 +63,3 @@ class Module(object):

-        self.mtime = 0
+        self.mtime = None # Guix sets all file mtimes to '0'
         self.enabled = True


code:
Remove non-UTF-8 character (this is a NO-BREAK SPACE character, encoded in
ISO-8859-1) to fix build failure with 'glib-mkenums' in GLib 2.54.2+.

Patch from <https://github.com/macports/macports-ports/commit/1f3efc8e65cc060d1701407bd1e56e62e6bd9c55>.

--- a/libgnome/gnome-config.h	2009-04-23 04:29:13.000000000 -0500
+++ b/libgnome/gnome-config.h	2017-10-04 02:17:22.000000000 -0500
@@ -270,7 +270,7 @@ void gnome_config_clean_key_ (const char
 #define gnome_config_private_clean_key(path) \
 	(gnome_config_clean_key_((path),TRUE))

-/* returns the true filename of the config file�*/
+/* returns the true filename of the config file */
 #define gnome_config_get_real_path(path) \
 	(g_build_filename (gnome_user_dir_get(),(path),NULL))
 #define gnome_config_private_get_real_path(path) \


code:
Fixes build with Python >= 3.6:

------
Making all in libgnomeui
make[2]: Entering directory '/tmp/guix-build-libgnomeui-2.24.5.drv-0/libgnomeui-2.24.5/libgnomeui'
  GEN    stamp-gnome-marshal.h
  GEN    stamp-gnometypebuiltins.h
INFO: Reading ./gnome-marshal.list...
  GEN    gnome-marshal.h
Traceback (most recent call last):
  File "/gnu/store/...-glib-2.54.2-bin/bin/glib-mkenums", line 688, in <module>
    process_file(fname)
  File "/gnu/store/...-glib-2.54.2-bin/bin/glib-mkenums", line 420, in process_file
    line = curfile.readline()
  File "/gnu/store/...-python-3.6.3/lib/python3.6/codecs.py", line 321, in decode
    (result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xf1 in position 1009: invalid continuation byte
make[2]: *** [Makefile:1109: stamp-gnometypebuiltins.h] Error 1
make[2]: Leaving directory '/tmp/guix-build-libgnomeui-2.24.5.drv-0/libgnomeui-2.24.5/libgnomeui'
make[1]: *** [Makefile:369: all-recursive] Error 1
make[1]: Leaving directory '/tmp/guix-build-libgnomeui-2.24.5.drv-0/libgnomeui-2.24.5'
make: *** [Makefile:296: all] Error 2
------

Patch copied from upstream source repository:

https://git.gnome.org/browse/libgnomeui/commit/?id=30334c28794ef85d8973f4ed0779b5ceed6594f2

From 30334c28794ef85d8973f4ed0779b5ceed6594f2 Mon Sep 17 00:00:00 2001
From: Colin Walters <walters@verbum.org>
Date: Mon, 7 Aug 2017 13:15:26 -0400
Subject: [PATCH] gnome-scores.h: Convert to UTF-8

The new Python `glib-mkenums` barfs on ISO-8859-1 input.
---
 libgnomeui/gnome-scores.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libgnomeui/gnome-scores.h b/libgnomeui/gnome-scores.h
index 911b12d1..4e641d22 100644
--- a/libgnomeui/gnome-scores.h
+++ b/libgnomeui/gnome-scores.h
@@ -27,7 +27,7 @@
  * "High Scores" Widget
  *
  * AUTHOR:
- * Horacio J. Pe�a <horape@compendium.com.ar>
+ * Horacio J. Peña <horape@compendium.com.ar>
  *
  * This is free software (under the terms of the GNU LGPL)
  *


code:
https://git.gnupg.org/cgi-bin/gitweb.cgi?p=libgpg-error.git;a=patch;h=791177de023574223eddf7288eb7c5a0721ac623

From 791177de023574223eddf7288eb7c5a0721ac623 Mon Sep 17 00:00:00 2001
From: Werner Koch <wk@gnupg.org>
Date: Sun, 18 Mar 2018 17:39:43 +0100
Subject: [PATCH] core: Fix regression on arm64 due to invalid use of va_list.

* src/logging.c (_gpgrt_log_printhex): Provide a dummy arg instead of
NULL.
--

Fix
Suggested-by: Jakub Wilk <jwilk@jwilk.net>

Signed-off-by: Werner Koch <wk@gnupg.org>
---
 src/logging.c | 18 ++++++++++++++----
 1 file changed, 14 insertions(+), 4 deletions(-)

diff --git a/src/logging.c b/src/logging.c
index 1a4f620..d01f974 100644
--- a/src/logging.c
+++ b/src/logging.c
@@ -1090,9 +1090,10 @@ _gpgrt_log_flush (void)

 /* Print a hexdump of (BUFFER,LENGTH).  With FMT passed as NULL print
- * just the raw dump, with FMT being an empty string, print a trailing
- * linefeed, otherwise print an entire debug line with the expanded
- * FMT followed by a possible wrapped hexdump and a final LF.  */
+ * just the raw dump (in this case ARG_PTR is not used), with FMT
+ * being an empty string, print a trailing linefeed, otherwise print
+ * an entire debug line with the expanded FMT followed by a possible
+ * wrapped hexdump and a final LF.  */
 void
 _gpgrt_logv_printhex (const void *buffer, size_t length,
                       const char *fmt, va_list arg_ptr)
@@ -1150,7 +1151,16 @@ _gpgrt_log_printhex (const void *buffer, size_t length,
       va_end (arg_ptr);
     }
   else
-    _gpgrt_logv_printhex (buffer, length, NULL, NULL);
+    {
+      /* va_list is not necessary a pointer and thus we can't use NULL
+       * because that would conflict with platforms using a straight
+       * struct for it (e.g. arm64).  We use a dummy variable instead;
+       * the static is a simple way zero it out so to not get
+       * complains about uninitialized use.  */
+      static va_list dummy_argptr;
+
+      _gpgrt_logv_printhex (buffer, length, NULL, dummy_argptr);
+    }
 }

--
2.8.0.rc3


code:
Fix CVE-2017-11590:

https://bugzilla.gnome.org/show_bug.cgi?id=785479
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-11590

Patch copied from upstream source repository:

https://git.gnome.org/browse/libgxps/commit/?id=9d5d292055250ed298f3b89dc332d6db4003a031

From 9d5d292055250ed298f3b89dc332d6db4003a031 Mon Sep 17 00:00:00 2001
From: Marek Kasik <mkasik@redhat.com>
Date: Wed, 26 Jul 2017 16:23:37 +0200
Subject: archive: Check for pathname being NULL before dereferencing

Check whether "archive_entry_pathname ()" returns a non-NULL pathname
before using it to avoid a NULL pointer being dereferenced.

https://bugzilla.gnome.org/show_bug.cgi?id=785479
---
 libgxps/gxps-archive.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/libgxps/gxps-archive.c b/libgxps/gxps-archive.c
index acf8d7d..e763773 100644
--- a/libgxps/gxps-archive.c
+++ b/libgxps/gxps-archive.c
@@ -257,6 +257,7 @@ gxps_archive_initable_init (GInitable     *initable,
 	GXPSArchive          *archive;
 	ZipArchive           *zip;
 	struct archive_entry *entry;
+	const gchar          *pathname;

 	archive = GXPS_ARCHIVE (initable);

@@ -281,7 +282,9 @@ gxps_archive_initable_init (GInitable     *initable,

         while (gxps_zip_archive_iter_next (zip, &entry)) {
                 /* FIXME: We can ignore directories here */
-                g_hash_table_add (archive->entries, g_strdup (archive_entry_pathname (entry)));
+                pathname = archive_entry_pathname (entry);
+                if (pathname != NULL)
+                        g_hash_table_add (archive->entries, g_strdup (pathname));
                 archive_read_data_skip (zip->archive);
         }

--
cgit v0.12


code:
Description: Fix function signature
Author: Mathieu Malaterre <malat@debian.org>
Origin: upstream, https://jxrlib.codeplex.com/SourceControl/changeset/04cf339385b8196f98025b43a366a0790deac994
Bug-Debian: http://bugs.debian.org/748590

--- jxrlib-1.1.orig/image/decode/JXRTranscode.c
+++ jxrlib-1.1/image/decode/JXRTranscode.c
@@ -47,7 +47,7 @@ EXTERN_C Void FreeCodingContextDec(CWMIm
 EXTERN_C Int StrEncInit(CWMImageStrCodec *);
 EXTERN_C Void StrIOEncTerm(CWMImageStrCodec *);
 EXTERN_C Void FreeCodingContextEnc(CWMImageStrCodec *);
-EXTERN_C Void encodeMB(CWMImageStrCodec *, Int, Int);
+EXTERN_C Int encodeMB(CWMImageStrCodec *, Int, Int);
 EXTERN_C Int  writeIndexTableNull(CWMImageStrCodec *);
 EXTERN_C Void writePacketHeader(BitIOInfo *, U8, U8);


code:
Description: Fix typos and remove some warnings
Author: Mathieu Malaterre <malat@debian.org>

Index: jxrlib-1.1/jxrencoderdecoder/JxrEncApp.c
===================================================================
--- jxrlib-1.1.orig/jxrencoderdecoder/JxrEncApp.c
+++ jxrlib-1.1/jxrencoderdecoder/JxrEncApp.c
@@ -578,7 +578,7 @@ main(int argc, char* argv[])

     //================================
     Call(PKCreateCodecFactory(&pCodecFactory, WMP_SDK_VERSION));
-    Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, &pEncoder));
+    Call(pCodecFactory->CreateCodec(&IID_PKImageWmpEncode, (void**)&pEncoder));

     //----------------------------------------------------------------
     Call(PKCreateTestFactory(&pTestFactory, WMP_SDK_VERSION));
Index: jxrlib-1.1/jxrgluelib/JXRMeta.h
===================================================================
--- jxrlib-1.1.orig/jxrgluelib/JXRMeta.h
+++ jxrlib-1.1/jxrgluelib/JXRMeta.h
@@ -34,7 +34,7 @@

 #ifndef UNREFERENCED_PARAMETER
 #define UNREFERENCED_PARAMETER(P) { (P) = (P); }
-#endif UNREFERENCED_PARAMETER
+#endif /*UNREFERENCED_PARAMETER*/

 //================================================================
 // Container


code:
Patch to fix build with Qt 5.5, taken from upstream:
   https://github.com/lxde/liblxqt/commit/7303ea207de0771d6f450a31ec4a1ce69202869b

diff -u -r liblxqt-0.9.0.orig/lxqtnotification.h liblxqt-0.9.0/lxqtnotification.h
--- liblxqt-0.9.0.orig/lxqtnotification.h	2015-07-27 22:49:05.365166482 +0200
+++ liblxqt-0.9.0/lxqtnotification.h	2015-07-27 22:49:36.897606619 +0200
@@ -25,6 +25,7 @@
 #ifndef LXQTNOTIFICATION_H
 #define LXQTNOTIFICATION_H

+#include <QObject>
 #include <QStringList>
 #include "lxqtglobals.h"


code:
Copied from Debian.

From: Konstantinos Margaritis <markos@debian.org>
Subject: use "adr" instead of "add" to make code ready for thumb2

--- ./imdct_l_arm.S.orig	2010-02-25 13:25:23.000000000 +0100
+++ ./imdct_l_arm.S	2010-02-25 13:27:26.000000000 +0100
@@ -468,7 +468,7 @@

     @----

-    add     r2, pc, #(imdct36_long_karray-.-8)  @ r2 = base address of Knn array (PIC safe ?)
+    adr     r2, imdct36_long_karray

 loop:


code:
Copied from Debian.

From: Dave Martin
Subject: "rsc" doesnt exist anymore in thumb2

diff --git a/fixed.h b/fixed.h
index 4b58abf..ba4bc26 100644
--- a/fixed.h
+++ b/fixed.h
@@ -275,12 +275,25 @@ mad_fixed_t mad_f_mul_inline(mad_fixed_t x, mad_fixed_t y)
 	 : "+r" (lo), "+r" (hi)  \
 	 : "%r" (x), "r" (y))

+#ifdef __thumb__
+/* In Thumb-2, the RSB-immediate instruction is only allowed with a zero
+	operand.  If needed this code can also support Thumb-1
+	(simply append "s" to the end of the second two instructions). */
+#  define MAD_F_MLN(hi, lo)  \
+    asm ("rsbs        %0, %0, #0\n\t"  \
+	 "sbc   %1, %1, %1\n\t"  \
+	 "sub   %1, %1, %2"  \
+	 : "+&r" (lo), "=&r" (hi)  \
+	 : "r" (hi)  \
+	 : "cc")
+#else /* ! __thumb__ */
 #  define MAD_F_MLN(hi, lo)  \
     asm ("rsbs	%0, %2, #0\n\t"  \
 	 "rsc	%1, %3, #0"  \
-	 : "=r" (lo), "=r" (hi)  \
+	 : "=&r" (lo), "=r" (hi)  \
 	 : "0" (lo), "1" (hi)  \
 	 : "cc")
+#endif /* __thumb__ */

 #  define mad_f_scale64(hi, lo)  \
     ({ mad_fixed_t __result;  \