-
Notifications
You must be signed in to change notification settings - Fork 12
RDKOSS-899 : DO NOT MERGE - bluezChk-RDKC #62
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -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 \ | ||||||||||||
| " | ||||||||||||
|
|
||||||||||||
|
Comment on lines
+63
to
65
|
||||||||||||
| file://bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch \ | |
| " | |
| " | |
| SRC_URI:append = "${@bb.utils.contains('DISTRO_FEATURES', 'coverity', ' file://bluez-5.48-071-RDKOSS-899-bluez-for-coverity-check.patch', '', d)}" |
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -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 */ | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+5
to
+30
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| @@ -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 */ | |
| @@ -166,6 +166,6 @@ static gboolean add_match(struct filter_data *data, | |
| { | |
| DBusError err; | |
| char rule[DBUS_MAXIMUM_MATCH_RULE_LENGTH]; | |
| format_rule(data, rule, sizeof(rule)); | |
| dbus_error_init(&err); | |
| @@ -178,6 +178,6 @@ static gboolean add_match(struct filter_data *data, | |
| return FALSE; | |
| } | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
PR description states "Risks: Low", but this change introduces an intentional NULL dereference and memory leak into BlueZ for all builds (via SRC_URI). Unless this is strictly gated to Coverity-only builds, the operational risk is high (potential crash under OOM). Please update the PR description risk assessment or change the implementation to ensure production builds are unaffected.