All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
@ 2014-09-10 12:42 gowtham babu
  2014-09-11  9:41 ` Szymon Janc
  0 siblings, 1 reply; 6+ messages in thread
From: gowtham babu @ 2014-09-10 12:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: d.kasatkin, bharat.panda, cpgs, gowtham babu

Handles the possible null pointer dereference: bd_addr by checking it against null.
---
 android/hal-utils.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/android/hal-utils.c b/android/hal-utils.c
index ceefefc..64ab5a1 100644
--- a/android/hal-utils.c
+++ b/android/hal-utils.c
@@ -166,11 +166,13 @@ int int2str_findstr(const char *str, const struct int2str m[])
  */
 const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf)
 {
-	const uint8_t *p = bd_addr->address;
+	const uint8_t *p;
 
 	if (!bd_addr)
 		return strcpy(buf, "NULL");
 
+	p = bd_addr->address;
+
 	snprintf(buf, MAX_ADDR_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x",
 					p[0], p[1], p[2], p[3], p[4], p[5]);
 
-- 
1.9.1


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

* Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
  2014-09-10 12:42 [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference gowtham babu
@ 2014-09-11  9:41 ` Szymon Janc
  2014-09-11 10:12   ` Gowtham Anandha Babu
  2014-09-11 10:16   ` Gowtham Anandha Babu
  0 siblings, 2 replies; 6+ messages in thread
From: Szymon Janc @ 2014-09-11  9:41 UTC (permalink / raw)
  To: gowtham babu; +Cc: linux-bluetooth, d.kasatkin, bharat.panda, cpgs

Hi,

On Wednesday 10 of September 2014 18:12:24 gowtham babu wrote:
> Handles the possible null pointer dereference: bd_addr by checking it against null.
> ---
>  android/hal-utils.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/android/hal-utils.c b/android/hal-utils.c
> index ceefefc..64ab5a1 100644
> --- a/android/hal-utils.c
> +++ b/android/hal-utils.c
> @@ -166,11 +166,13 @@ int int2str_findstr(const char *str, const struct int2str m[])
>   */
>  const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf)
>  {
> -	const uint8_t *p = bd_addr->address;
> +	const uint8_t *p;
>  
>  	if (!bd_addr)
>  		return strcpy(buf, "NULL");
>  
> +	p = bd_addr->address;
> +
>  	snprintf(buf, MAX_ADDR_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x",
>  					p[0], p[1], p[2], p[3], p[4], p[5]);
>  

This patch looks OK to me, but I have one question before applying it.

Do you really want your name to be visible in git history as it is in this
email ie. without any capital letters?

-- 
Best regards, 
Szymon Janc

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

* RE: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
  2014-09-11  9:41 ` Szymon Janc
@ 2014-09-11 10:12   ` Gowtham Anandha Babu
  2014-09-11 10:16   ` Gowtham Anandha Babu
  1 sibling, 0 replies; 6+ messages in thread
From: Gowtham Anandha Babu @ 2014-09-11 10:12 UTC (permalink / raw)
  To: 'Szymon Janc'; +Cc: linux-bluetooth, d.kasatkin, bharat.panda, cpgs

Hi,
That’s fine.

Regards
Gowtham

> -----Original Message-----
> From: Szymon Janc [mailto:szymon.janc@tieto.com]
> Sent: Thursday, September 11, 2014 3:11 PM
> To: gowtham babu
> Cc: linux-bluetooth@vger.kernel.org; d.kasatkin@samsung.com;
> bharat.panda@samsung.com; cpgs@samsung.com
> Subject: Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
> 
> Hi,
> 
> On Wednesday 10 of September 2014 18:12:24 gowtham babu wrote:
> > Handles the possible null pointer dereference: bd_addr by checking it
> against null.
> > ---
> >  android/hal-utils.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/android/hal-utils.c b/android/hal-utils.c index
> > ceefefc..64ab5a1 100644
> > --- a/android/hal-utils.c
> > +++ b/android/hal-utils.c
> > @@ -166,11 +166,13 @@ int int2str_findstr(const char *str, const struct
> int2str m[])
> >   */
> >  const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf)  {
> > -	const uint8_t *p = bd_addr->address;
> > +	const uint8_t *p;
> >
> >  	if (!bd_addr)
> >  		return strcpy(buf, "NULL");
> >
> > +	p = bd_addr->address;
> > +
> >  	snprintf(buf, MAX_ADDR_STR_LEN,
> "%02x:%02x:%02x:%02x:%02x:%02x",
> >  					p[0], p[1], p[2], p[3], p[4], p[5]);
> >
> 
> This patch looks OK to me, but I have one question before applying it.
> 
> Do you really want your name to be visible in git history as it is in this email ie.
> without any capital letters?
> 
> --
> Best regards,
> Szymon Janc


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

* RE: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
  2014-09-11  9:41 ` Szymon Janc
  2014-09-11 10:12   ` Gowtham Anandha Babu
@ 2014-09-11 10:16   ` Gowtham Anandha Babu
  2014-09-11 11:33     ` Luiz Augusto von Dentz
  1 sibling, 1 reply; 6+ messages in thread
From: Gowtham Anandha Babu @ 2014-09-11 10:16 UTC (permalink / raw)
  To: 'Szymon Janc'; +Cc: linux-bluetooth, d.kasatkin, bharat.panda, cpgs

Hi,

> -----Original Message-----
> From: Szymon Janc [mailto:szymon.janc@tieto.com]
> Sent: Thursday, September 11, 2014 3:11 PM
> To: gowtham babu
> Cc: linux-bluetooth@vger.kernel.org; d.kasatkin@samsung.com;
> bharat.panda@samsung.com; cpgs@samsung.com
> Subject: Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
> 
> Hi,
> 
> On Wednesday 10 of September 2014 18:12:24 gowtham babu wrote:
> > Handles the possible null pointer dereference: bd_addr by checking it
> against null.
> > ---
> >  android/hal-utils.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/android/hal-utils.c b/android/hal-utils.c index
> > ceefefc..64ab5a1 100644
> > --- a/android/hal-utils.c
> > +++ b/android/hal-utils.c
> > @@ -166,11 +166,13 @@ int int2str_findstr(const char *str, const struct
> int2str m[])
> >   */
> >  const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf)  {
> > -	const uint8_t *p = bd_addr->address;
> > +	const uint8_t *p;
> >
> >  	if (!bd_addr)
> >  		return strcpy(buf, "NULL");
> >
> > +	p = bd_addr->address;
> > +
> >  	snprintf(buf, MAX_ADDR_STR_LEN,
> "%02x:%02x:%02x:%02x:%02x:%02x",
> >  					p[0], p[1], p[2], p[3], p[4], p[5]);
> >
> 
> This patch looks OK to me, but I have one question before applying it.
> 
> Do you really want your name to be visible in git history as it is in this email ie.
> without any capital letters?
> 
> --
> Best regards,
> Szymon Janc


Sorry for the top posting. Regarding the git name, that’s  OK. 

Regards,
Gowtham


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

* Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
  2014-09-11 10:16   ` Gowtham Anandha Babu
@ 2014-09-11 11:33     ` Luiz Augusto von Dentz
  2014-09-11 13:28       ` Gowtham Anandha Babu
  0 siblings, 1 reply; 6+ messages in thread
From: Luiz Augusto von Dentz @ 2014-09-11 11:33 UTC (permalink / raw)
  To: Gowtham Anandha Babu
  Cc: Szymon Janc, linux-bluetooth, Dmitry Kasatkin, Bharat Panda, cpgs

Hi,

On Thu, Sep 11, 2014 at 1:16 PM, Gowtham Anandha Babu
<gowtham.ab@samsung.com> wrote:
> Hi,
>
>> -----Original Message-----
>> From: Szymon Janc [mailto:szymon.janc@tieto.com]
>> Sent: Thursday, September 11, 2014 3:11 PM
>> To: gowtham babu
>> Cc: linux-bluetooth@vger.kernel.org; d.kasatkin@samsung.com;
>> bharat.panda@samsung.com; cpgs@samsung.com
>> Subject: Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
>>
>> Hi,
>>
>> On Wednesday 10 of September 2014 18:12:24 gowtham babu wrote:
>> > Handles the possible null pointer dereference: bd_addr by checking it
>> against null.
>> > ---
>> >  android/hal-utils.c | 4 +++-
>> >  1 file changed, 3 insertions(+), 1 deletion(-)
>> >
>> > diff --git a/android/hal-utils.c b/android/hal-utils.c index
>> > ceefefc..64ab5a1 100644
>> > --- a/android/hal-utils.c
>> > +++ b/android/hal-utils.c
>> > @@ -166,11 +166,13 @@ int int2str_findstr(const char *str, const struct
>> int2str m[])
>> >   */
>> >  const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf)  {
>> > -   const uint8_t *p = bd_addr->address;
>> > +   const uint8_t *p;
>> >
>> >     if (!bd_addr)
>> >             return strcpy(buf, "NULL");
>> >
>> > +   p = bd_addr->address;
>> > +
>> >     snprintf(buf, MAX_ADDR_STR_LEN,
>> "%02x:%02x:%02x:%02x:%02x:%02x",
>> >                                     p[0], p[1], p[2], p[3], p[4], p[5]);
>> >
>>
>> This patch looks OK to me, but I have one question before applying it.
>>
>> Do you really want your name to be visible in git history as it is in this email ie.
>> without any capital letters?
>>
>> --
>> Best regards,
>> Szymon Janc
>
>
> Sorry for the top posting. Regarding the git name, that’s  OK.

Just be consistent, in this one you actually are using capital letter
and a middle name.


-- 
Luiz Augusto von Dentz

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

* RE: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
  2014-09-11 11:33     ` Luiz Augusto von Dentz
@ 2014-09-11 13:28       ` Gowtham Anandha Babu
  0 siblings, 0 replies; 6+ messages in thread
From: Gowtham Anandha Babu @ 2014-09-11 13:28 UTC (permalink / raw)
  To: 'Luiz Augusto von Dentz'
  Cc: 'Szymon Janc', linux-bluetooth, 'Dmitry Kasatkin',
	'Bharat Panda',
	cpgs

Hi,

> -----Original Message-----
> From: Luiz Augusto von Dentz [mailto:luiz.dentz@gmail.com]
> Sent: Thursday, September 11, 2014 5:04 PM
> To: Gowtham Anandha Babu
> Cc: Szymon Janc; linux-bluetooth@vger.kernel.org; Dmitry Kasatkin; Bharat
> Panda; cpgs@samsung.com
> Subject: Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference
> 
> Hi,
> 
> On Thu, Sep 11, 2014 at 1:16 PM, Gowtham Anandha Babu
> <gowtham.ab@samsung.com> wrote:
> > Hi,
> >
> >> -----Original Message-----
> >> From: Szymon Janc [mailto:szymon.janc@tieto.com]
> >> Sent: Thursday, September 11, 2014 3:11 PM
> >> To: gowtham babu
> >> Cc: linux-bluetooth@vger.kernel.org; d.kasatkin@samsung.com;
> >> bharat.panda@samsung.com; cpgs@samsung.com
> >> Subject: Re: [PATCH 3/3] android/hal-utils.c : Fix null pointer
> >> dereference
> >>
> >> Hi,
> >>
> >> On Wednesday 10 of September 2014 18:12:24 gowtham babu wrote:
> >> > Handles the possible null pointer dereference: bd_addr by checking
> >> > it
> >> against null.
> >> > ---
> >> >  android/hal-utils.c | 4 +++-
> >> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/android/hal-utils.c b/android/hal-utils.c index
> >> > ceefefc..64ab5a1 100644
> >> > --- a/android/hal-utils.c
> >> > +++ b/android/hal-utils.c
> >> > @@ -166,11 +166,13 @@ int int2str_findstr(const char *str, const
> >> > struct
> >> int2str m[])
> >> >   */
> >> >  const char *bt_bdaddr_t2str(const bt_bdaddr_t *bd_addr, char *buf)  {
> >> > -   const uint8_t *p = bd_addr->address;
> >> > +   const uint8_t *p;
> >> >
> >> >     if (!bd_addr)
> >> >             return strcpy(buf, "NULL");
> >> >
> >> > +   p = bd_addr->address;
> >> > +
> >> >     snprintf(buf, MAX_ADDR_STR_LEN,
> >> "%02x:%02x:%02x:%02x:%02x:%02x",
> >> >                                     p[0], p[1], p[2], p[3], p[4],
> >> > p[5]);
> >> >
> >>
> >> This patch looks OK to me, but I have one question before applying it.
> >>
> >> Do you really want your name to be visible in git history as it is in this email
> ie.
> >> without any capital letters?
> >>
> >> --
> >> Best regards,
> >> Szymon Janc
> >
> >
> > Sorry for the top posting. Regarding the git name, that’s  OK.
> 
> Just be consistent, in this one you actually are using capital letter and a
> middle name.
> 
> 
> --
> Luiz Augusto von Dentz


Sorry for the naming conflicts, I had sent all the patches again with my complete name. Please have a look at it.

Regards,
Gowtham


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

end of thread, other threads:[~2014-09-11 13:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-09-10 12:42 [PATCH 3/3] android/hal-utils.c : Fix null pointer dereference gowtham babu
2014-09-11  9:41 ` Szymon Janc
2014-09-11 10:12   ` Gowtham Anandha Babu
2014-09-11 10:16   ` Gowtham Anandha Babu
2014-09-11 11:33     ` Luiz Augusto von Dentz
2014-09-11 13:28       ` Gowtham Anandha Babu

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.