This repository has been archived by the owner on May 20, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 252
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
archrelease: copy trunk to extra-x86_64
git-svn-id: file:///srv/repos/svn-packages/svn@407648 eb2447ed-0c53-47e4-bac8-5bc4a241df78
- Loading branch information
andyrtr
authored and
svntogit
committed
Feb 8, 2021
1 parent
8311edd
commit cbf5a39
Showing
2 changed files
with
53 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
45 changes: 45 additions & 0 deletions
45
repos/extra-x86_64/fix_crash_when_SEP_codec_has_not_been_initialized.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
From 326d70edd99c3f21cf299dba55214e2c8957e622 Mon Sep 17 00:00:00 2001 | ||
From: Luiz Augusto von Dentz <luiz.von.dentz@intel.com> | ||
Date: Mon, 23 Nov 2020 10:20:06 -0800 | ||
Subject: [PATCH] a2dp: Fix crash when SEP codec has not been initialized | ||
|
||
If SEP has not been properly discovered avdtp_get_codec may return NULL | ||
thus causing crashes such as: | ||
|
||
https://github.com/bluez/bluez/issues/57 | ||
--- | ||
profiles/audio/a2dp.c | 11 ++++++++--- | ||
1 file changed, 8 insertions(+), 3 deletions(-) | ||
|
||
diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c | ||
index 59d11a0aa..f1e4fa990 100644 | ||
--- a/profiles/audio/a2dp.c | ||
+++ b/profiles/audio/a2dp.c | ||
@@ -1887,8 +1887,8 @@ static void register_remote_sep(void *data, void *user_data) | ||
sep, remote_sep_free) == FALSE) { | ||
error("Could not register remote sep %s", sep->path); | ||
free(sep->path); | ||
- sep->path = NULL; | ||
- goto done; | ||
+ free(sep); | ||
+ return; | ||
} | ||
|
||
DBG("Found remote SEP: %s", sep->path); | ||
@@ -2627,10 +2627,15 @@ static void store_remote_sep(void *data, void *user_data) | ||
GKeyFile *key_file = user_data; | ||
char seid[4], value[256]; | ||
struct avdtp_service_capability *service = avdtp_get_codec(sep->sep); | ||
- struct avdtp_media_codec_capability *codec = (void *) service->data; | ||
+ struct avdtp_media_codec_capability *codec; | ||
unsigned int i; | ||
ssize_t offset; | ||
|
||
+ if (!service) | ||
+ return; | ||
+ | ||
+ codec = (void *) service->data; | ||
+ | ||
sprintf(seid, "%02hhx", avdtp_get_seid(sep->sep)); | ||
|
||
offset = sprintf(value, "%02hhx:%02hhx:%02hhx:", |