diff options
Diffstat (limited to 'recipes-core/swupd-client')
-rw-r--r-- | recipes-core/swupd-client/swupd-client-2.87/0001-log.c-Check-filename-for-NULL-before-logging-it.patch | 34 | ||||
-rw-r--r-- | recipes-core/swupd-client/swupd-client_2.87.bb | 1 |
2 files changed, 35 insertions, 0 deletions
diff --git a/recipes-core/swupd-client/swupd-client-2.87/0001-log.c-Check-filename-for-NULL-before-logging-it.patch b/recipes-core/swupd-client/swupd-client-2.87/0001-log.c-Check-filename-for-NULL-before-logging-it.patch new file mode 100644 index 0000000..9487b17 --- /dev/null +++ b/recipes-core/swupd-client/swupd-client-2.87/0001-log.c-Check-filename-for-NULL-before-logging-it.patch @@ -0,0 +1,34 @@ +From c4ac8d370d3a842e32756481ee594bacfe1f5059 Mon Sep 17 00:00:00 2001 +From: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com> +Date: Wed, 13 Apr 2016 10:11:51 +0300 +Subject: [PATCH] log.c: Check filename for NULL before logging it + +In many error situations a fake file struct is passed to +the logger. The filename field of the struct needs to be +checked for NULL before printing it to a log to avoid +dereference of a NULL-pointer. + +Upstream-Status: Inappropriate [the latest upstream version doesn't use +this code] + +Signed-off-by: Dmitry Rozhkov <dmitry.rozhkov@linux.intel.com> +--- + src/log.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/log.c b/src/log.c +index 5e5b030..2e3f693 100644 +--- a/src/log.c ++++ b/src/log.c +@@ -412,7 +412,7 @@ static char *format_log_message(int log_type, enum log_priority priority, struct + filebuf[PATH_MAXLEN - 1] = 0; + filebuf2[0] = 0; + strncpy(filebuf, filename, PATH_MAXLEN - 1); +- if (file) { ++ if (file && file->filename) { + strncpy(filebuf2, file->filename, PATH_MAXLEN - 1); + filebuf2[PATH_MAXLEN - 1] = 0; + } +-- +2.5.0 + diff --git a/recipes-core/swupd-client/swupd-client_2.87.bb b/recipes-core/swupd-client/swupd-client_2.87.bb index 011d238..251a94f 100644 --- a/recipes-core/swupd-client/swupd-client_2.87.bb +++ b/recipes-core/swupd-client/swupd-client_2.87.bb @@ -12,6 +12,7 @@ SRC_URI = "\ file://0005-swupd-client-Add-existence-check-to-staging-target.patch \ file://0006-Backport-Use-rename-instead-of-tar-transform.patch \ file://0007-Add-compatibility-with-libarchive-s-bsdtar-command.patch \ + file://0001-log.c-Check-filename-for-NULL-before-logging-it.patch \ " SRC_URI[md5sum] = "5d272c62edb8a9c576005ac5e1182ea3" |