File: agent-Assert-possible-infinite-loop.patch

package info (click to toggle)
bluez 5.84-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 19,776 kB
  • sloc: ansic: 418,350; python: 4,751; sh: 4,580; makefile: 738; xml: 126
file content (21 lines) | stat: -rw-r--r-- 499 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
From: Bastien Nocera <hadess@hadess.net>
Date: Mon, 9 Dec 2013 18:04:56 +0100
Subject: [PATCH 4/5] agent: Assert possible infinite loop

---
 src/agent.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/agent.c b/src/agent.c
index 7d66cf5..beec3c8 100644
--- a/src/agent.c
+++ b/src/agent.c
@@ -205,6 +205,8 @@ void agent_unref(struct agent *agent)
 	if (agent->ref > 0)
 		return;
 
+	g_assert (agent->ref == 0);
+
 	if (agent->request) {
 		DBusError err;
 		agent_pincode_cb pincode_cb;