From 165a3ea58061825c668ce9d852b49dbb37722152 Mon Sep 17 00:00:00 2001 From: ppalan289 Date: Tue, 21 Apr 2026 09:22:50 +0000 Subject: [PATCH] RDKOSS-899 : DO NOT MERGE - bluezChk-RDKC Reason for change: Inclusion of coverity for BT Test Procedure: NA Risks: Low Priority: P2 Signed-off-by: ppalan289 --- .../bluez5/bluez5_5.48.bbappend | 1 + ...-RDKOSS-899-bluez-for-coverity-check.patch | 33 +++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 recipes-connectivity/bluez5/bluez5_5.48/bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch diff --git a/recipes-connectivity/bluez5/bluez5_5.48.bbappend b/recipes-connectivity/bluez5/bluez5_5.48.bbappend index 76273b9..8fbd722 100644 --- a/recipes-connectivity/bluez5/bluez5_5.48.bbappend +++ b/recipes-connectivity/bluez5/bluez5_5.48.bbappend @@ -60,6 +60,7 @@ SRC_URI:append = " \ file://bluez-5.48-068-RDKOSS-553-stream-use-after-free.patch \ file://bluez-5.48-069-RDKEMW-11885-UAF-in-messagefilter.patch \ file://bluez-5.48-070-ES1-2351-remove-corrupted-hog.patch \ + file://bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch \ " FILESEXTRAPATHS:prepend := "${THISDIR}/${PN}:" diff --git a/recipes-connectivity/bluez5/bluez5_5.48/bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch b/recipes-connectivity/bluez5/bluez5_5.48/bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch new file mode 100644 index 0000000..7af710b --- /dev/null +++ b/recipes-connectivity/bluez5/bluez5_5.48/bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch @@ -0,0 +1,33 @@ +diff --git a/gdbus/watch.c b/gdbus/watch.c +index 447e48671..17878cafb 100644 +--- a/gdbus/watch.c ++++ b/gdbus/watch.c +@@ -166,6 +166,20 @@ static gboolean add_match(struct filter_data *data, + { + DBusError err; + char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; ++ char *coverity_test_buf; ++ ++ /* Intentionally allocate memory and do not free it on all paths ++ * Used to validate Coverity RESOURCE_LEAK detection ++ */ ++ coverity_test_buf = g_new0(char, 16); ++ ++ /* Intentionally introduce NULL dereference before NULL check ++ * Used to validate Coverity NULL_DEREFERENCE detection ++ */ ++ coverity_test_buf[0] = 'C'; ++ ++ if (coverity_test_buf == NULL) ++ return FALSE; + + format_rule(data, rule, sizeof(rule)); + dbus_error_init(&err); +@@ -178,6 +192,7 @@ static gboolean add_match(struct filter_data *data, + return FALSE; + } + ++ /* coverity_test_buf intentionally not freed */ + data->handle_func = filter; + data->registered = TRUE; +