summaryrefslogtreecommitdiffstats
path: root/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch')
-rw-r--r--meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch37
1 files changed, 0 insertions, 37 deletions
diff --git a/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch b/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch
deleted file mode 100644
index c92b58609c..0000000000
--- a/meta/recipes-connectivity/connman/connman/0001-storage-check-that-the-string-isn-t-empty-before-spl.patch
+++ /dev/null
@@ -1,37 +0,0 @@
1From ea8c7b3efce4c1762411e073893e948de5d552d6 Mon Sep 17 00:00:00 2001
2From: Ross Burton <ross.burton@intel.com>
3Date: Tue, 17 Jul 2012 16:04:12 +0100
4Subject: [PATCH] storage: check that the string isn't empty before splitting
5
6If the string was non-NULL but empty (str="\0"), the following \0 assignment
7would write to str[-1] and thus cause memory corruption.
8
9On PPC and MIPS, this was causing crashes in glibc.
10
11Signed-off-by: Ross Burton <ross.burton@intel.com>
12Upstream-Status: Submitted
13
14---
15 src/storage.c | 6 +++++-
16 1 file changed, 5 insertions(+), 1 deletion(-)
17
18diff --git a/src/storage.c b/src/storage.c
19index 47bd0cb..20766a3 100644
20--- a/src/storage.c
21+++ b/src/storage.c
22@@ -212,7 +212,11 @@ gchar **connman_storage_get_services()
23 closedir(dir);
24
25 str = g_string_free(result, FALSE);
26- if (str) {
27+ if (str && str[0] != '\0') {
28+ /*
29+ * Remove the trailing separator so that services doesn't end up
30+ * with an empty element.
31+ */
32 str[strlen(str) - 1] = '\0';
33 services = g_strsplit(str, "/", -1);
34 }
35--
361.7.10.4
37