All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sathish Narasimman <sathish.n@globaledgesoft.com>
To: linux-bluetooth@vger.kernel.org
Cc: johan.hedberg@gmail.com, girish.br@globaledgesoft.com,
	anderson.lizardo@openbossa.org, sathish.n@globaledgesoft.com,
	ajay.kv@globaledgesoft.com
Subject: [PATCH BlueZ] attrib: Fix interactive gatttool Segfault
Date: Thu, 18 Jul 2013 19:32:32 +0530	[thread overview]
Message-ID: <1374156152-17448-1-git-send-email-sathish.n@globaledgesoft.com> (raw)

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


             reply	other threads:[~2013-07-18 14:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-18 14:02 Sathish Narasimman [this message]
  -- strict thread matches above, loose matches on Subject: below --
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
2013-07-18 10:42 [PATCH bluez] " Sathish N
2013-07-18 11:16 ` Johan Hedberg
2013-07-18 14:03   ` Sathish N

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1374156152-17448-1-git-send-email-sathish.n@globaledgesoft.com \
    --to=sathish.n@globaledgesoft.com \
    --cc=ajay.kv@globaledgesoft.com \
    --cc=anderson.lizardo@openbossa.org \
    --cc=girish.br@globaledgesoft.com \
    --cc=johan.hedberg@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.