Linux bluetooth development
 help / color / mirror / Atom feed
* [PATCH] Fix missing initialization of eir name_len
@ 2011-10-18 10:42 chanyeol.park
  2011-10-18 10:58 ` Johan Hedberg
  0 siblings, 1 reply; 2+ messages in thread
From: chanyeol.park @ 2011-10-18 10:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: chanyeol.park

From: Chan-yeol Park <chanyeol.park@samsung.com>

---
 src/eir.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/eir.c b/src/eir.c
index e82d30b..b76bfa2 100644
--- a/src/eir.c
+++ b/src/eir.c
@@ -70,7 +70,7 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data)
 	uuid_t service;
 	char *uuid_str;
 	const char *name = NULL;
-	size_t name_len;
+	size_t name_len = 0;
 	unsigned int i;
 
 	eir->flags = -1;
-- 
1.7.4.1


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

* Re: [PATCH] Fix missing initialization of eir name_len
  2011-10-18 10:42 [PATCH] Fix missing initialization of eir name_len chanyeol.park
@ 2011-10-18 10:58 ` Johan Hedberg
  0 siblings, 0 replies; 2+ messages in thread
From: Johan Hedberg @ 2011-10-18 10:58 UTC (permalink / raw)
  To: chanyeol.park; +Cc: linux-bluetooth

Hi Chan-yeol,

On Tue, Oct 18, 2011, chanyeol.park@samsung.com wrote:
> From: Chan-yeol Park <chanyeol.park@samsung.com>
> 
> ---
>  src/eir.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/src/eir.c b/src/eir.c
> index e82d30b..b76bfa2 100644
> --- a/src/eir.c
> +++ b/src/eir.c
> @@ -70,7 +70,7 @@ int eir_parse(struct eir_data *eir, uint8_t *eir_data)
>  	uuid_t service;
>  	char *uuid_str;
>  	const char *name = NULL;
> -	size_t name_len;
> +	size_t name_len = 0;
>  	unsigned int i;
>  
>  	eir->flags = -1;

This was already discussed on the list:
http://www.spinics.net/lists/linux-bluetooth/msg17222.html

It's essentially a gcc bug which doesn't show up with newer gcc
versions. Instead of adding this unnecessary initialization, Marcels
proposal was to rewrite the eir_parse function since its logic is quite
hard to follow right now.

Johan

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

end of thread, other threads:[~2011-10-18 10:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-18 10:42 [PATCH] Fix missing initialization of eir name_len chanyeol.park
2011-10-18 10:58 ` Johan Hedberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox