drop old patches

This commit is contained in:
Peter Robinson 2013-03-19 23:32:00 +00:00
parent 9300c848f5
commit dad41870e6
2 changed files with 0 additions and 87 deletions

View File

@ -1,60 +0,0 @@
From 490c134a282c7091ee20918022bcf6a3607ec99a Mon Sep 17 00:00:00 2001
From: Bastien Nocera <hadess@hadess.net>
Date: Wed, 5 Sep 2012 10:07:15 +0100
Subject: [PATCH] Don't crash if $HOME is empty
If both $XDG_CONFIG_HOME and $HOME are unset, we'd try to copy a NULL
string, causing a crash. This is the environment systemd provides to
its daemons, and that was causing upowerd to crash.
http://libiphone.lighthouseapp.com/projects/27916-libiphone/tickets/273-patch-fix-segfault-when-running-with-home-unset#ticket-273-2
http://libiphone.lighthouseapp.com/projects/27916/tickets/265-userpref_get_config_dir-segfaults-when-home-is-undefined
https://bugzilla.redhat.com/show_bug.cgi?id=834359
---
src/userpref.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)
diff --git a/src/userpref.c b/src/userpref.c
index a0c3545..0e774b7 100644
--- a/src/userpref.c
+++ b/src/userpref.c
@@ -102,6 +102,20 @@ static char *userpref_utf16_to_utf8(wchar_t *unistr, long len, long *items_read,
}
#endif
+static const char *userpref_get_tmp_dir()
+{
+ const char *cdir = getenv("TMPDIR");
+ if (cdir && cdir[0])
+ return cdir;
+ cdir = getenv("TMP");
+ if (cdir && cdir[0])
+ return cdir;
+ cdir = getenv("TEMP");
+ if (cdir && cdir[0])
+ return cdir;
+ return "/tmp";
+}
+
static const char *userpref_get_config_dir()
{
if (__config_dir[0]) return __config_dir;
@@ -125,7 +139,14 @@ static const char *userpref_get_config_dir()
const char *cdir = getenv("XDG_CONFIG_HOME");
if (!cdir) {
cdir = getenv("HOME");
- strcpy(__config_dir, cdir);
+ if (!cdir || !cdir[0]) {
+ const char *tdir = userpref_get_tmp_dir();
+ strcpy(__config_dir, tdir);
+ strcat(__config_dir, DIR_SEP_S);
+ strcat(__config_dir, "root");
+ } else {
+ strcpy(__config_dir, cdir);
+ }
strcat(__config_dir, DIR_SEP_S);
strcat(__config_dir, ".config");
} else {
--
1.7.11.2

View File

@ -1,27 +0,0 @@
From 060e3f2683ed2b0b08e1a31deb9608a99e193b4a Mon Sep 17 00:00:00 2001
From: Christophe Fergeau <teuf@gnome.org>
Date: Tue, 26 Jun 2012 00:03:30 +0200
Subject: [PATCH] property_list_service: do not strip non-ASCII characters from
XML plists
'content' is declared as char content[] so if char is signed, all characters with the high bit set will be negative so they will be < 0x20. This means the code will strip all non-ASCII (multi-byte) UTF-8 characters and replace them with spaces. This commit fixes it now by really only considering ASCII characters.
---
src/property_list_service.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/property_list_service.c b/src/property_list_service.c
index 8634864..c9a8edf 100644
--- a/src/property_list_service.c
+++ b/src/property_list_service.c
@@ -250,7 +250,7 @@ static property_list_service_error_t internal_plist_receive_timeout(property_lis
} else {
/* iOS 4.3+ hack: plist data might contain invalid characters, thus we convert those to spaces */
for (bytes = 0; bytes < pktlen-1; bytes++) {
- if ((content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d))
+ if ((content[bytes] >= 0) && (content[bytes] < 0x20) && (content[bytes] != 0x09) && (content[bytes] != 0x0a) && (content[bytes] != 0x0d))
content[bytes] = 0x20;
}
plist_from_xml(content, pktlen, plist);
--
1.8.1.2