summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2017-06-07 08:04:31 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-06-12 15:08:30 +0100
commit5a9cc41a3bbe3f955bf570d99f6474aa44b23d25 (patch)
treea19a5db09df53a138a2c9289a1dca3377d8fa9ee
parentd31bc5c5157acc11e22974459e8107fd5b5ae375 (diff)
downloadpoky-5a9cc41a3bbe3f955bf570d99f6474aa44b23d25.tar.gz
cve-check-tool: fix crash on exceptions
This fixes cve-check-tool crashes on exceptions. (From OE-Core rev: 06bea09755ebda9bcfa49bf87249f80cb019157e) Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb1
-rw-r--r--meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch50
2 files changed, 51 insertions, 0 deletions
diff --git a/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb b/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
index 1f906ee0a4..4829b118fe 100644
--- a/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
+++ b/meta/recipes-devtools/cve-check-tool/cve-check-tool_5.6.4.bb
@@ -11,6 +11,7 @@ SRC_URI = "https://github.com/ikeydoherty/${BPN}/releases/download/v${PV}/${BP}.
11 file://0001-print-progress-in-percent-when-downloading-CVE-db.patch \ 11 file://0001-print-progress-in-percent-when-downloading-CVE-db.patch \
12 file://0001-curl-allow-overriding-default-CA-certificate-file.patch \ 12 file://0001-curl-allow-overriding-default-CA-certificate-file.patch \
13 file://0001-update-Compare-computed-vs-expected-sha256-digit-str.patch \ 13 file://0001-update-Compare-computed-vs-expected-sha256-digit-str.patch \
14 file://0001-Fix-freeing-memory-allocated-by-sqlite.patch \
14 " 15 "
15 16
16SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155" 17SRC_URI[md5sum] = "c5f4247140fc9be3bf41491d31a34155"
diff --git a/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch b/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch
new file mode 100644
index 0000000000..4a82cf2dde
--- /dev/null
+++ b/meta/recipes-devtools/cve-check-tool/files/0001-Fix-freeing-memory-allocated-by-sqlite.patch
@@ -0,0 +1,50 @@
1From a3353429652f83bb8b0316500faa88fa2555542d Mon Sep 17 00:00:00 2001
2From: Peter Marko <peter.marko@siemens.com>
3Date: Thu, 13 Apr 2017 23:09:52 +0200
4Subject: [PATCH] Fix freeing memory allocated by sqlite
5
6Upstream-Status: Backport
7Signed-off-by: Peter Marko <peter.marko@siemens.com>
8---
9 src/core.c | 8 ++++----
10 1 file changed, 4 insertions(+), 4 deletions(-)
11
12diff --git a/src/core.c b/src/core.c
13index 6263031..6788f16 100644
14--- a/src/core.c
15+++ b/src/core.c
16@@ -82,7 +82,7 @@ static bool ensure_table(CveDB *self)
17 rc = sqlite3_exec(self->db, query, NULL, NULL, &err);
18 if (rc != SQLITE_OK) {
19 fprintf(stderr, "ensure_table(): %s\n", err);
20- free(err);
21+ sqlite3_free(err);
22 return false;
23 }
24
25@@ -91,7 +91,7 @@ static bool ensure_table(CveDB *self)
26 rc = sqlite3_exec(self->db, query, NULL, NULL, &err);
27 if (rc != SQLITE_OK) {
28 fprintf(stderr, "ensure_table(): %s\n", err);
29- free(err);
30+ sqlite3_free(err);
31 return false;
32 }
33
34@@ -99,11 +99,11 @@ static bool ensure_table(CveDB *self)
35 rc = sqlite3_exec(self->db, query, NULL, NULL, &err);
36 if (rc != SQLITE_OK) {
37 fprintf(stderr, "ensure_table(): %s\n", err);
38- free(err);
39+ sqlite3_free(err);
40 return false;
41 }
42 if (err) {
43- free(err);
44+ sqlite3_free(err);
45 }
46
47 return true;
48--
492.1.4
50