2011-05-15 10:37:41

by Bartosz Szatkowski

[permalink] [raw]
Subject: [PATCH v2] Fix endian conversion for appparams in pbap client

---
client/pbap.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/client/pbap.c b/client/pbap.c
index 837419c..589b1ca 100644
--- a/client/pbap.c
+++ b/client/pbap.c
@@ -312,7 +312,7 @@ static void read_return_apparam(struct session_data *session,
if (hdr->len == PHONEBOOKSIZE_LEN) {
guint16 val;
memcpy(&val, hdr->val, sizeof(val));
- *phone_book_size = val;
+ *phone_book_size = get_be16(&val);
}
break;
case NEWMISSEDCALLS_TAG:
--
1.7.5.rc3



2011-05-15 11:49:37

by Johan Hedberg

[permalink] [raw]
Subject: Re: [PATCH v2] Fix endian conversion for appparams in pbap client

Hi Bartosz,

On Sun, May 15, 2011, Bartosz Szatkowski wrote:
> ---
> client/pbap.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/client/pbap.c b/client/pbap.c
> index 837419c..589b1ca 100644
> --- a/client/pbap.c
> +++ b/client/pbap.c
> @@ -312,7 +312,7 @@ static void read_return_apparam(struct session_data *session,
> if (hdr->len == PHONEBOOKSIZE_LEN) {
> guint16 val;
> memcpy(&val, hdr->val, sizeof(val));
> - *phone_book_size = val;
> + *phone_book_size = get_be16(&val);
> }
> break;
> case NEWMISSEDCALLS_TAG:

Pushed upstream. Thanks.

Johan