[PW_SID:1089698] [BlueZ,1/2] mpris-proxy: Fix possible crash#2097
[PW_SID:1089698] [BlueZ,1/2] mpris-proxy: Fix possible crash#2097BluezTestBot wants to merge 2 commits into
Conversation
find_player_by_obex() doesn't check whether session->obex is a valid pointer before dereferecing it, but all code paths that assign it use create_obex_session() to assign it, a function that can fail. Check whether session->obex is null before dereferencing it. #0 find_player_by_obex at tools/mpris-proxy.c:2819 #1 obex_property_changed at tools/mpris-proxy.c:2929 #2 add_property at gdbus/client.c:373 #3 update_properties at gdbus/client.c:399 #5 properties_changed at gdbus/client.c:537 #6 signal_filter at gdbus/watch.c:416 #7 message_filter at gdbus/watch.c:566 #10 message_dispatch at gdbus/mainloop.c:59 #13 g_main_context_dispatch_unlocked at ../glib/gmain.c:4451 #14 g_main_context_iterate_unlocked at ../glib/gmain.c:4516 Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2466640
Protect against trying to access session->obex variable that might be null after failure to create the session object.
|
CheckPatch |
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Duplication | 0 |
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
|
GitLint |
|
BuildEll |
|
BluezMake |
|
CheckSmatch |
|
bluezmakeextell |
|
IncrementalBuild |
|
ScanBuild |
find_player_by_obex() doesn't check whether session->obex is a valid
pointer before dereferecing it, but all code paths that assign it use
create_obex_session() to assign it, a function that can fail.
Check whether session->obex is null before dereferencing it.
#0 find_player_by_obex at tools/mpris-proxy.c:2819
#1 obex_property_changed at tools/mpris-proxy.c:2929
#2 add_property at gdbus/client.c:373
#3 update_properties at gdbus/client.c:399
#5 properties_changed at gdbus/client.c:537
#6 signal_filter at gdbus/watch.c:416
#7 message_filter at gdbus/watch.c:566
#10 message_dispatch at gdbus/mainloop.c:59
#13 g_main_context_dispatch_unlocked at ../glib/gmain.c:4451
#14 g_main_context_iterate_unlocked at ../glib/gmain.c:4516
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2466640
tools/mpris-proxy.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)