From: "José Antonio Santos Cadenas" <jcaden@libresoft.es>
To: "Elvis Pfützenreuter" <epx@signove.com>
Cc: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH 1/1] Fixes sdp_get_supp_feat function
Date: Fri, 14 May 2010 09:02:23 +0200 [thread overview]
Message-ID: <201005140902.23338.jcaden@libresoft.es> (raw)
In-Reply-To: <1273806810-29602-1-git-send-email-epx@signove.com>
Hi Elvis,
El Friday 14 May 2010 05:13:30 Elvis Pfützenreuter escribió:
> In case of string data items, value is a pointer by itself.
> ---
> lib/sdp.c | 7 ++++++-
> 1 files changed, 6 insertions(+), 1 deletions(-)
>
> diff --git a/lib/sdp.c b/lib/sdp.c
> index fb8ccdc..c75a000 100644
> --- a/lib/sdp.c
> +++ b/lib/sdp.c
> @@ -4801,10 +4801,15 @@ int sdp_get_supp_feat(const sdp_record_t *rec,
> sdp_list_t **seqp) subseq = NULL;
> for (dd = d->val.dataseq; dd; dd = dd->next) {
> sdp_data_t *data;
> + void *val;
> if (dd->dtd != SDP_UINT8 && dd->dtd != SDP_UINT16 &&
> dd->dtd != SDP_TEXT_STR8)
> goto fail;
> - data = sdp_data_alloc(dd->dtd, &dd->val);
> + if (dd->dtd == SDP_TEXT_STR8)
> + val = dd->val.str;
> + else
> + val = &dd->val;
> + data = sdp_data_alloc(dd->dtd, val);
No only strings are pointers, if you see this patch:
http://git.kernel.org/?p=bluetooth/bluez.git;a=commit;h=1d1154156df28660e41031df5c3f1ffe91c01aae
that I sent few days ago for fixing the set function, also sequences are
pointers and should be treated in a different way. Also strings can be formed
by other types not only SDP_TEXT_STR8. I think a switch will fix this better.
> if (data)
> subseq = sdp_list_append(subseq, data);
> }
Regards.
next prev parent reply other threads:[~2010-05-14 7:02 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-05-14 3:13 [PATCH 1/1] Fixes sdp_get_supp_feat function Elvis Pfützenreuter
2010-05-14 7:02 ` José Antonio Santos Cadenas [this message]
2010-05-14 12:58 ` Elvis Pfützenreuter
2010-05-14 14:50 ` José Antonio Santos Cadenas
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=201005140902.23338.jcaden@libresoft.es \
--to=jcaden@libresoft.es \
--cc=epx@signove.com \
--cc=linux-bluetooth@vger.kernel.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.