From 6045050bc66c8aa99aa12aa0404cd6d8543eafa5 Mon Sep 17 00:00:00 2001 From: Matt Ranostay Date: Wed, 29 Mar 2017 06:05:49 +0000 Subject: faac: fix format security issue Port patchsets from Khem Raj's tree to fix -Wformat-security issue that was exposed with security options to the compiler. Change-Id: I3c746f71484bc3cb4b210f956465147918856340 AGL-Spec: SPEC-504 Signed-off-by: Matt Ranostay --- meta-agl/recipes-multimedia/faac/faac_%.bbappend | 4 ++++ ...frontend-Fix-format-string-security-error.patch | 26 ++++++++++++++++++++ ...Define-__STRING-if-cdefs.h-does-not-exist.patch | 28 ++++++++++++++++++++++ 3 files changed, 58 insertions(+) create mode 100644 meta-agl/recipes-multimedia/faac/faac_%.bbappend create mode 100644 meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch create mode 100644 meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch diff --git a/meta-agl/recipes-multimedia/faac/faac_%.bbappend b/meta-agl/recipes-multimedia/faac/faac_%.bbappend new file mode 100644 index 000000000..4ada05d80 --- /dev/null +++ b/meta-agl/recipes-multimedia/faac/faac_%.bbappend @@ -0,0 +1,4 @@ +FILESEXTRAPATHS_prepend := "${THISDIR}/files:" +SRI_SRC += "file://0001-frontend-Fix-format-string-security-error.patch \ + file://0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch \ + " diff --git a/meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch b/meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch new file mode 100644 index 000000000..75e003eac --- /dev/null +++ b/meta-agl/recipes-multimedia/faac/files/0001-frontend-Fix-format-string-security-error.patch @@ -0,0 +1,26 @@ +From c1d7a8b992dc36d0012cc3d54b7d3abf4ad4d5d8 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 28 Mar 2017 21:33:01 -0700 +Subject: [PATCH 1/2] frontend: Fix format string security error + +Signed-off-by: Khem Raj +--- + frontend/main.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/frontend/main.c b/frontend/main.c +index 02146a8..cb9329c 100644 +--- a/frontend/main.c ++++ b/frontend/main.c +@@ -715,7 +715,7 @@ int main(int argc, char *argv[]) + break; + #endif + case 'L': +- fprintf(stderr, faac_copyright_string); ++ fprintf(stderr, "%s", faac_copyright_string); + dieMessage = license; + break; + case 'X': +-- +2.12.1 + diff --git a/meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch b/meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch new file mode 100644 index 000000000..d845ddf59 --- /dev/null +++ b/meta-agl/recipes-multimedia/faac/files/0002-mp4v2-Define-__STRING-if-cdefs.h-does-not-exist.patch @@ -0,0 +1,28 @@ +From 46cc9298c38b9dd735fec3f39aa2d6e56a362410 Mon Sep 17 00:00:00 2001 +From: Khem Raj +Date: Tue, 28 Mar 2017 21:33:36 -0700 +Subject: [PATCH 2/2] mp4v2: Define __STRING if cdefs.h does not exist + +Signed-off-by: Khem Raj +--- + common/mp4v2/mp4util.h | 4 ++++ + 1 file changed, 4 insertions(+) + +diff --git a/common/mp4v2/mp4util.h b/common/mp4v2/mp4util.h +index 1f9cb64..1e7aced 100644 +--- a/common/mp4v2/mp4util.h ++++ b/common/mp4v2/mp4util.h +@@ -23,6 +23,10 @@ + #define __MP4_UTIL_INCLUDED__ + #include + ++#ifndef __STRING ++#define __STRING(x) #x ++#endif ++ + #ifndef ASSERT + #define ASSERT(expr) \ + if (!(expr)) { \ +-- +2.12.1 + -- cgit 1.2.3-korg