All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH bluez] attrib: Fix interactive gatttool segfault
@ 2013-07-18 10:42 Sathish N
  2013-07-18 11:16 ` Johan Hedberg
  0 siblings, 1 reply; 7+ messages in thread
From: Sathish N @ 2013-07-18 10:42 UTC (permalink / raw)
  To: linux-bluetooth; +Cc: girish.br, sathish.n, ajay.kv, anderson.lizardo

From: sathish N <sathish.n@globaledgesoft.com>

---
 bluez/attrib/interactive.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bluez/attrib/interactive.c b/bluez/attrib/interactive.c
index f28dc22..4fd7276 100644
--- a/bluez/attrib/interactive.c
+++ b/bluez/attrib/interactive.c
@@ -867,7 +867,8 @@ static void parse_line(char *line_read)
 
 	add_history(line_read);
 
-	g_shell_parse_argv(line_read, &argcp, &argvp, NULL);
+	if (g_shell_parse_argv(line_read, &argcp, &argvp, NULL) == FALSE)
+		goto done;
 
 	for (i = 0; commands[i].cmd; i++)
 		if (strcasecmp(commands[i].cmd, argvp[0]) == 0)
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH BlueZ] attrib: Fix interactive gatttool Segfault
@ 2013-07-18 14:02 Sathish Narasimman
  0 siblings, 0 replies; 7+ messages in thread
From: Sathish Narasimman @ 2013-07-18 14:02 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: johan.hedberg, girish.br, anderson.lizardo, sathish.n, ajay.kv

From: Sathish N <sathish.n@globaledgesoft.com>

passing the special character single quote

$gatttool -I
[   ][                 ][LE]> '
Segmentation fault (core dumped)

Checking g_shell_parse_argv fail status(return FALSE on failure), works fine.

hope the fix to the previous "git am" error is solved

---
 attrib/interactive.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/attrib/interactive.c b/attrib/interactive.c
index f28dc22..df5dc52 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -867,7 +867,8 @@ static void parse_line(char *line_read)
 
 	add_history(line_read);
 
-	g_shell_parse_argv(line_read, &argcp, &argvp, NULL);
+	if (g_shell_parse_argv(line_read, &argcp, &argvp, NULL) = FALSE)
+		goto done;
 
 	for (i = 0; commands[i].cmd; i++)
 		if (strcasecmp(commands[i].cmd, argvp[0]) == 0)
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 7+ messages in thread
* [PATCH BlueZ] attrib: Fix interactive gatttool segfault
@ 2013-07-19  4:31 Sathish Narasimman
  2013-07-19 11:03 ` Anderson Lizardo
  2013-07-19 11:26 ` Johan Hedberg
  0 siblings, 2 replies; 7+ messages in thread
From: Sathish Narasimman @ 2013-07-19  4:31 UTC (permalink / raw)
  To: linux-bluetooth
  Cc: johan.hedberg, girish.br, anderson.lizardo, sathish.n, ajay.kv

passing the special character single quote

$gatttool -I
[   ][                 ][LE]> '
Segmentation fault (core dumped)

Checking g_shell_parse_argv fail status(return FALSE on failure), works fine.

hope the fix to the previous "git am" error is solved

---
 attrib/interactive.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/attrib/interactive.c b/attrib/interactive.c
index f28dc22..4fd7276 100644
--- a/attrib/interactive.c
+++ b/attrib/interactive.c
@@ -867,7 +867,8 @@ static void parse_line(char *line_read)
 
 	add_history(line_read);
 
-	g_shell_parse_argv(line_read, &argcp, &argvp, NULL);
+	if (g_shell_parse_argv(line_read, &argcp, &argvp, NULL) == FALSE)
+		goto done;
 
 	for (i = 0; commands[i].cmd; i++)
 		if (strcasecmp(commands[i].cmd, argvp[0]) == 0)
-- 
1.7.9.5


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

end of thread, other threads:[~2013-07-19 11:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-18 10:42 [PATCH bluez] attrib: Fix interactive gatttool segfault Sathish N
2013-07-18 11:16 ` Johan Hedberg
2013-07-18 14:03   ` Sathish N
2013-07-18 14:02 [PATCH BlueZ] attrib: Fix interactive gatttool Segfault Sathish Narasimman
2013-07-19  4:31 [PATCH BlueZ] attrib: Fix interactive gatttool segfault Sathish Narasimman
2013-07-19 11:03 ` Anderson Lizardo
2013-07-19 11:26 ` Johan Hedberg

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.