diff options
author | Sathish Narasimman <sathish.n@globaledgesoft.com> | 2013-07-19 10:01:52 +0530 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@intel.com> | 2013-07-19 14:24:55 +0300 |
commit | 03375be73a966e1eafbc658893fd46955409d9df (patch) | |
tree | 0471966acd987150fc7d1fef7c36378c6e9e5f75 /attrib/interactive.c | |
parent | f763e5e3e42f92365b89af7eb3cb51e91de72690 (diff) | |
download | bluez-03375be73a966e1eafbc658893fd46955409d9df.tar.gz |
attrib: Fix interactive gatttool segfault
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.
Diffstat (limited to 'attrib/interactive.c')
-rw-r--r-- | attrib/interactive.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/attrib/interactive.c b/attrib/interactive.c index f28dc22fe..4fd7276eb 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) |