aboutsummaryrefslogtreecommitdiff
path: root/libmetalink/0001-fix-covscan-issues.patch
diff options
context:
space:
mode:
authorB Stack <bgstack15@gmail.com>2019-10-23 22:36:30 -0400
committerB Stack <bgstack15@gmail.com>2019-10-23 22:36:30 -0400
commit77d9e73d5c8345e0bc14c35fc1e711db3bf6fe9e (patch)
tree15854b4457141136704e419348059b8a6476a2fc /libmetalink/0001-fix-covscan-issues.patch
downloadffs-dependencies-master.tar.gz
ffs-dependencies-master.tar.bz2
ffs-dependencies-master.zip
initial commitHEADmaster
Diffstat (limited to 'libmetalink/0001-fix-covscan-issues.patch')
-rw-r--r--libmetalink/0001-fix-covscan-issues.patch54
1 files changed, 54 insertions, 0 deletions
diff --git a/libmetalink/0001-fix-covscan-issues.patch b/libmetalink/0001-fix-covscan-issues.patch
new file mode 100644
index 0000000..c5d2824
--- /dev/null
+++ b/libmetalink/0001-fix-covscan-issues.patch
@@ -0,0 +1,54 @@
+From 204c580643f7c52364520926b9df3a621fab6df7 Mon Sep 17 00:00:00 2001
+From: Martin Sehnoutka <msehnout@redhat.com>
+Date: Tue, 24 Jul 2018 15:10:40 +0200
+Subject: [PATCH] fix covscan issues
+
+---
+ lib/libexpat_metalink_parser.c | 3 +++
+ lib/metalink_pctrl.c | 2 ++
+ 2 files changed, 5 insertions(+)
+
+diff --git a/lib/libexpat_metalink_parser.c b/lib/libexpat_metalink_parser.c
+index 4e73aef..79b091c 100644
+--- a/lib/libexpat_metalink_parser.c
++++ b/lib/libexpat_metalink_parser.c
+@@ -29,6 +29,7 @@
+
+ #include <string.h>
+ #include <unistd.h>
++#include <stdlib.h>
+ #include <errno.h>
+ #include <assert.h>
+
+@@ -56,6 +57,8 @@ static void split_ns_name(const char** localname,
+ *localname = sep+1;
+ len = sep-src;
+ temp = malloc((len+1) * sizeof **ns_uri);
++ if (temp == NULL)
++ exit(EXIT_FAILURE);
+ memcpy(temp, src, len);
+ temp[len] = '\0';
+ *ns_uri = temp;
+diff --git a/lib/metalink_pctrl.c b/lib/metalink_pctrl.c
+index c25989b..e6fb8f8 100644
+--- a/lib/metalink_pctrl.c
++++ b/lib/metalink_pctrl.c
+@@ -469,6 +469,7 @@ metalink_error_t metalink_pctrl_file_set_language(metalink_pctrl_t* ctrl, const
+ l = strdup(language);
+ ctrl->languages = metalink_list_new();
+ if(!ctrl->languages || !l || metalink_list_append(ctrl->languages, l) != 0) {
++ if (l) free(l);
+ return METALINK_ERR_BAD_ALLOC;
+ }
+
+@@ -486,6 +487,7 @@ metalink_error_t metalink_pctrl_file_set_os(metalink_pctrl_t* ctrl, const char*
+ o = strdup(os);
+ ctrl->oses = metalink_list_new();
+ if(!ctrl->oses || !o || metalink_list_append(ctrl->oses, o) != 0) {
++ if (o) free(o);
+ return METALINK_ERR_BAD_ALLOC;
+ }
+
+--
+2.17.1
+
bgstack15