From: David Herrmann <dh.herrmann@gmail.com>
To: linux-bluetooth@vger.kernel.org
Cc: Johan Hedberg <johan.hedberg@intel.com>,
Marcel Holtmann <marcel@holtmann.org>,
David Herrmann <dh.herrmann@gmail.com>
Subject: [PATCH bluez] sdptool: fix recursive search
Date: Mon, 18 Mar 2013 18:41:02 +0100 [thread overview]
Message-ID: <1363628462-3421-1-git-send-email-dh.herrmann@gmail.com> (raw)
When doing recursive SDP searches, we must not overwrite our own values
after we retrieved them from SDP. Otherwise, the UUID test will always we
false.
---
tools/sdptool.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/tools/sdptool.c b/tools/sdptool.c
index 458d005..0a949f2 100644
--- a/tools/sdptool.c
+++ b/tools/sdptool.c
@@ -3812,9 +3812,10 @@ static int do_search(bdaddr_t *bdaddr, struct search_context *context)
break;
}
+ /* Set the subcontext for browsing the sub tree */
+ memcpy(&sub_context, context, sizeof(struct search_context));
+
if (sdp_get_group_id(rec, &sub_context.group) != -1) {
- /* Set the subcontext for browsing the sub tree */
- memcpy(&sub_context, context, sizeof(struct search_context));
/* Browse the next level down if not done */
if (sub_context.group.value.uuid16 != context->group.value.uuid16)
do_search(bdaddr, &sub_context);
--
1.8.2
next reply other threads:[~2013-03-18 17:41 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-18 17:41 David Herrmann [this message]
2013-03-25 10:46 ` [PATCH bluez] sdptool: fix recursive search Johan Hedberg
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1363628462-3421-1-git-send-email-dh.herrmann@gmail.com \
--to=dh.herrmann@gmail.com \
--cc=johan.hedberg@intel.com \
--cc=linux-bluetooth@vger.kernel.org \
--cc=marcel@holtmann.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.