linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] avinfo: Fix parsing capabilities
@ 2019-01-26 10:24 Pali Rohár
  2019-01-31 10:49 ` Luiz Augusto von Dentz
  0 siblings, 1 reply; 2+ messages in thread
From: Pali Rohár @ 2019-01-26 10:24 UTC (permalink / raw)
  To: linux-bluetooth

Function print_caps() expects capabilities buffer without AVDTP header.
Previously avinfo somehow worked, because AVDTP header looks like
capability header with unknown category which was skipped.
---
 tools/avinfo.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/avinfo.c b/tools/avinfo.c
index 02fc1f233..a3298e8c8 100644
--- a/tools/avinfo.c
+++ b/tools/avinfo.c
@@ -809,7 +809,7 @@ static ssize_t avdtp_get_caps(int sk, int seid)
 		return -1;
 	}
 
-	print_caps(caps, ret);
+	print_caps(caps->caps, ret - sizeof(struct getcap_resp));
 
 	return 0;
 }
-- 
2.11.0


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

* Re: [PATCH] avinfo: Fix parsing capabilities
  2019-01-26 10:24 [PATCH] avinfo: Fix parsing capabilities Pali Rohár
@ 2019-01-31 10:49 ` Luiz Augusto von Dentz
  0 siblings, 0 replies; 2+ messages in thread
From: Luiz Augusto von Dentz @ 2019-01-31 10:49 UTC (permalink / raw)
  To: Pali Rohár; +Cc: linux-bluetooth

Hi Pali,
On Sat, Jan 26, 2019 at 12:25 PM Pali Rohár <pali.rohar@gmail.com> wrote:
>
> Function print_caps() expects capabilities buffer without AVDTP header.
> Previously avinfo somehow worked, because AVDTP header looks like
> capability header with unknown category which was skipped.
> ---
>  tools/avinfo.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/avinfo.c b/tools/avinfo.c
> index 02fc1f233..a3298e8c8 100644
> --- a/tools/avinfo.c
> +++ b/tools/avinfo.c
> @@ -809,7 +809,7 @@ static ssize_t avdtp_get_caps(int sk, int seid)
>                 return -1;
>         }
>
> -       print_caps(caps, ret);
> +       print_caps(caps->caps, ret - sizeof(struct getcap_resp));
>
>         return 0;
>  }
> --
> 2.11.0

Applied, thanks.

-- 
Luiz Augusto von Dentz

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

end of thread, other threads:[~2019-01-31 10:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-26 10:24 [PATCH] avinfo: Fix parsing capabilities Pali Rohár
2019-01-31 10:49 ` Luiz Augusto von Dentz

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).