linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH BlueZ 0/4] Fix few more bugs found by SVACE
@ 2022-05-07 15:06 Ildar Kamaletdinov
  2022-05-07 15:06 ` [PATCH BlueZ 1/4] tools: Fix memory leak in hciconfig Ildar Kamaletdinov
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Ildar Kamaletdinov @ 2022-05-07 15:06 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ildar Kamaletdinov

This patch set includes few fixes for bugs that was found by 
Linux Verification Center (linuxtesting.org) with the SVACE static 
analysis tool.

Ildar Kamaletdinov (4):
  tools: Fix memory leak in hciconfig
  tools: Fix memory leaks in btgatt-server/client
  tools: Fix handle leak in rfcomm
  device: Fix uninitialized value usage

 src/device.c          | 3 ++-
 tools/btgatt-client.c | 5 ++++-
 tools/btgatt-server.c | 5 ++++-
 tools/hciconfig.c     | 5 ++++-
 tools/rfcomm.c        | 4 ++++
 5 files changed, 18 insertions(+), 4 deletions(-)

-- 
2.35.3


^ permalink raw reply	[flat|nested] 8+ messages in thread
* [PATCH BlueZ 1/4] tools: Fix memory leak in hciconfig
@ 2022-05-07 17:07 Ildar Kamaletdinov
  2022-05-07 20:00 ` Fix few more bugs found by SVACE bluez.test.bot
  0 siblings, 1 reply; 8+ messages in thread
From: Ildar Kamaletdinov @ 2022-05-07 17:07 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ildar Kamaletdinov

printf() was using function that return dynamic allocated memory as
a parameter.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.
---
 tools/hciconfig.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index e4d521583..e1b73f22a 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -80,7 +80,11 @@ static void print_pkt_type(struct hci_dev_info *di)
 
 static void print_link_policy(struct hci_dev_info *di)
 {
-	printf("\tLink policy: %s\n", hci_lptostr(di->link_policy));
+	char *str;
+	
+	str = hci_lptostr(di->link_policy);
+	printf("\tLink policy: %s\n", str);
+	bt_free(str);
 }
 
 static void print_link_mode(struct hci_dev_info *di)
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread
* [PATCH BlueZ 1/4] tools: Fix memory leak in hciconfig
@ 2022-05-07 17:35 Ildar Kamaletdinov
  2022-05-07 20:16 ` Fix few more bugs found by SVACE bluez.test.bot
  0 siblings, 1 reply; 8+ messages in thread
From: Ildar Kamaletdinov @ 2022-05-07 17:35 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: Ildar Kamaletdinov

printf() was using function that return dynamic allocated memory as
a parameter.

Found by Linux Verification Center (linuxtesting.org) with the SVACE
static analysis tool.
---
 tools/hciconfig.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/tools/hciconfig.c b/tools/hciconfig.c
index e4d521583..a1c615bfa 100644
--- a/tools/hciconfig.c
+++ b/tools/hciconfig.c
@@ -80,7 +80,11 @@ static void print_pkt_type(struct hci_dev_info *di)
 
 static void print_link_policy(struct hci_dev_info *di)
 {
-	printf("\tLink policy: %s\n", hci_lptostr(di->link_policy));
+	char *str;
+
+	str = hci_lptostr(di->link_policy);
+	printf("\tLink policy: %s\n", str);
+	bt_free(str);
 }
 
 static void print_link_mode(struct hci_dev_info *di)
-- 
2.35.3


^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2022-05-07 20:16 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-07 15:06 [PATCH BlueZ 0/4] Fix few more bugs found by SVACE Ildar Kamaletdinov
2022-05-07 15:06 ` [PATCH BlueZ 1/4] tools: Fix memory leak in hciconfig Ildar Kamaletdinov
2022-05-07 17:53   ` Fix few more bugs found by SVACE bluez.test.bot
2022-05-07 15:06 ` [PATCH BlueZ 2/4] tools: Fix memory leaks in btgatt-server/client Ildar Kamaletdinov
2022-05-07 15:06 ` [PATCH BlueZ 3/4] tools: Fix handle leak in rfcomm Ildar Kamaletdinov
2022-05-07 15:06 ` [PATCH BlueZ 4/4] device: Fix uninitialized value usage Ildar Kamaletdinov
2022-05-07 17:07 [PATCH BlueZ 1/4] tools: Fix memory leak in hciconfig Ildar Kamaletdinov
2022-05-07 20:00 ` Fix few more bugs found by SVACE bluez.test.bot
2022-05-07 17:35 [PATCH BlueZ 1/4] tools: Fix memory leak in hciconfig Ildar Kamaletdinov
2022-05-07 20:16 ` Fix few more bugs found by SVACE bluez.test.bot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).