Skip to contentSkip to conversation

Fix double free in obexd/client.

PATCH Applied Ismagil Iskakov 3 participants 4 messages Jul 7, 2025 Bluetooth drivers

lore
Share & tools
lore
#0 lore raw

cover Fix double free in obexd/client.

This patch fixes double free that could have happened when 'contents' in obc_transfer_get_contents could not be read. The second free then would've occured in image_properties_complete_cb at the end.

Ismagil Iskakov (1):
obexd/client: prevent double freeing

 obexd/client/transfer.c | 1 +
 1 file changed, 1 insertion(+)
Signature · 1 line
2.34.1
#1 lore raw

PATCH 1/1 obexd/client: prevent double freeing

image_properties_complete_cb frees 'contents' after a failure. However obc_transfer_get_contents does it beforehand.

---
 obexd/client/transfer.c | 1 +
 1 file changed, 1 insertion(+)
obexd/client/transfer.c +1 -0
index 668cefa40..a7d00896f 100644
@@ -971,6 +971,7 @@ int obc_transfer_get_contents(struct obc_transfer *transfer, char **contents,
 	if (ret < 0) {
 		error("read(): %s(%d)", strerror(errno), errno);
 		g_free(*contents);
+		*contents = NULL;
 		return -errno;
 	}
 
Signature · 1 line
2.34.1
#2 lore raw

This is automated email and please do not reply to this email!

Dear submitter,

Thank you for submitting the patches to the linux bluetooth mailing list. This is a CI test results with your patch series:
PW Link:https://patchwork.kernel.org/project/bluetooth/list/?series=979723

---Test result---

Test Summary:

CheckPatch                    PENDING   0.24 seconds
GitLint                       PENDING   0.27 seconds
BuildEll                      PASS      20.29 seconds
BluezMake                     PASS      2553.27 seconds
MakeCheck                     PASS      20.61 seconds
MakeDistcheck                 PASS      184.93 seconds
CheckValgrind                 PASS      237.09 seconds
CheckSmatch                   PASS      305.93 seconds
bluezmakeextell               PASS      129.42 seconds
IncrementalBuild              PENDING   0.28 seconds
ScanBuild                     PASS      916.91 seconds

Details
##############################
Test: CheckPatch - PENDING
Desc: Run checkpatch.pl script
Output:

##############################
Test: GitLint - PENDING
Desc: Run gitlint
Output:

##############################
Test: IncrementalBuild - PENDING
Desc: Incremental build with the patches in the series Output:

---
Regards,
Linux Bluetooth

#3 lore raw
In reply to Ismagil Iskakov
This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Hello:

This patch was applied to bluetooth/bluez.git (master) by Luiz Augusto von Dentz <[email protected]>:

Quoted 9 lines · On Mon, 7 Jul 2025 17:52:41 +0300 you wrote:

This patch fixes double free that could have happened when 'contents' in obc_transfer_get_contents could not be read. The second free then would've occured in image_properties_complete_cb at the end.

Ismagil Iskakov (1):
obexd/client: prevent double freeing

[...]

Here is the summary with links:
- [BlueZ,1/1] obexd/client: prevent double freeing

    https://git.kernel.org/pub/scm/bluetooth/bluez.git/?id=be8c031baaa8

You are awesome, thank you!

Signature · 2 lines
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html