Linux-Bluetooth Archive on lore.kernel.org
 help / 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	[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, back to index

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

Linux-Bluetooth Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-bluetooth/0 linux-bluetooth/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-bluetooth linux-bluetooth/ https://lore.kernel.org/linux-bluetooth \
		linux-bluetooth@vger.kernel.org linux-bluetooth@archiver.kernel.org
	public-inbox-index linux-bluetooth


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-bluetooth


AGPL code for this site: git clone https://public-inbox.org/ public-inbox