cdparanoia: Fix build with security flags
PATCH 1/2 cdparanoia: Fix build with security flags
Signed-off-by Khem Raj <[email protected]>
--- .../cdparanoia/cdparanoia_10.2.bb | 4 ++- ...-for-null-buffer-before-trying-a-byteswap.patch | 31 +++++++++++++++++++++ .../files/0002-Fix-printf-format-errors.patch | 32 ++++++++++++++++++++++ 3 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch create mode 100644 meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch
meta-multimedia/recipes-multimedia/cdparanoia/cdparanoia_10.2.bb +3 -1
@@ -13,7 +13,9 @@ SRC_URI = "http://downloads.xiph.org/releases/cdparanoia/cdparanoia-III-${PV}.sr file://0003-Fix-missing-shared-object-LDFLAGS.patch \ file://dont-use-internal-configs.patch \ file://out-of-tree-build.patch \ -" + file://0001-check-for-null-buffer-before-trying-a-byteswap.patch \ + file://0002-Fix-printf-format-errors.patch \ + " SRC_URI[md5sum] = "b304bbe8ab63373924a744eac9ebc652" SRC_URI[sha256sum] = "005db45ef4ee017f5c32ec124f913a0546e77014266c6a1c50df902a55fe64df"
meta-multimedia/recipes-multimedia/cdparanoia/files/0001-check-for-null-buffer-before-trying-a-byteswap.patch new file +31 -0
@@ -0,0 +1,31 @@ +From c760c5d31f2412a5be5ac6896e6069d1cea08527 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Mon, 26 Jun 2017 22:31:45 -0700 +Subject: [PATCH 1/2] check for null buffer before trying a byteswap + +Author: Monty <[email protected]> + +Patch from debian +http://sources.debian.net/src/cdparanoia/3.10.2%2Bdebian-11/debian/patches/04-endian.patch + +Signed-off-by: Khem Raj <[email protected]> +--- + interface/interface.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/interface/interface.c b/interface/interface.c +index 526c2a9..763a0ea 100644 +--- a/interface/interface.c ++++ b/interface/interface.c +@@ -118,7 +118,7 @@ long cdda_read_timed(cdrom_drive *d, void *buffer, long beginsector, long sector + if(d->bigendianp==-1) /* not determined yet */ + d->bigendianp=data_bigendianp(d); + +- if(d->bigendianp!=bigendianp()){ ++ if(buffer && d->bigendianp!=bigendianp()){ + int i; + u_int16_t *p=(u_int16_t *)buffer; + long els=sectors*CD_FRAMESIZE_RAW/2; +-- +2.13.2 +
meta-multimedia/recipes-multimedia/cdparanoia/files/0002-Fix-printf-format-errors.patch new file +32 -0
@@ -0,0 +1,32 @@ +From f4f81bdadb9515938b3b5d13707bd4b9322fd967 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Mon, 26 Jun 2017 22:37:13 -0700 +Subject: [PATCH 2/2] Fix printf format errors + +error: format not a string literal and no format arguments + +Signed-off-by: Khem Raj <[email protected]> +--- + main.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +diff --git a/main.c b/main.c +index 664acac..d568fb1 100644 +--- a/main.c ++++ b/main.c +@@ -588,10 +588,10 @@ static void callback(long inpos, int function){ + buffer[aheadposition+19]='>'; + } + +- fprintf(stderr,buffer); ++ fprintf(stderr, "%s", buffer); + + if (logfile != NULL && function==-1) { +- fprintf(logfile,buffer+1); ++ fprintf(logfile, "%s", buffer+1); + fprintf(logfile,"\n\n"); + fflush(logfile); + } +-- +2.13.2 +
Signature · 1 line
2.13.2
PATCH 2/2 rdate: Fix build with hardening
Signed-off-by Khem Raj <[email protected]>
--- .../0001-src-rdate-Fix-printf-format-errors.patch | 33 ++++++++++++++++++++++ .../recipes-connectivity/rdate/rdate_1.5.bb | 4 ++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch
meta-networking/recipes-connectivity/rdate/rdate/0001-src-rdate-Fix-printf-format-errors.patch new file +33 -0
@@ -0,0 +1,33 @@ +From f58bcb43c31d08de58853b088681cbe4df36cbf9 Mon Sep 17 00:00:00 2001 +From: Khem Raj <[email protected]> +Date: Mon, 26 Jun 2017 22:50:56 -0700 +Subject: [PATCH] src/rdate: Fix printf format errors + +Fixes + +rdate.c:85:41: error: format not a string literal and no format arguments [-Werror=format-security] +| syslog(is_error?LOG_WARNING:LOG_INFO, buf); + +Signed-off-by: Khem Raj <[email protected]> +--- +Upstream-Status: Submitted + + src/rdate.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/rdate.c b/src/rdate.c +index 5c3e829..943d481 100644 +--- a/src/rdate.c ++++ b/src/rdate.c +@@ -82,7 +82,7 @@ write_log(int is_error, char *format, ...) + return; /* Error, which we can't report because this _is_ the error + reporting mechanism */ + if(log_mode) +- syslog(is_error?LOG_WARNING:LOG_INFO, buf); ++ syslog(is_error?LOG_WARNING:LOG_INFO, "%s", buf); + if(is_error || print_mode) + fprintf(is_error?stderr:stdout, "%s: %s\n", argv0, buf); + } +-- +2.13.2 +
meta-networking/recipes-connectivity/rdate/rdate_1.5.bb +3 -1
@@ -11,7 +11,9 @@ SECTION = "Applications/System" LICENSE = "GPLv2" LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3" -SRC_URI= "https://www.aelius.com/njh/${BPN}/${BP}.tar.gz" +SRC_URI = "https://www.aelius.com/njh/${BPN}/${BP}.tar.gz \ + file://0001-src-rdate-Fix-printf-format-errors.patch \ + " SRC_URI[md5sum] = "0a4f612480777fdf25264ac03c57eae6" SRC_URI[sha256sum] = "6e800053eaac2b21ff4486ec42f0aca7214941c7e5fceedd593fa0be99b9227d"
Signature · 1 line
2.13.2