diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2009-11-10 07:31:31 +0100 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2009-11-10 12:59:30 -0600 |
commit | 19187a0ee7acfbb91fac8d1be5c2a80ffb3f4028 (patch) | |
tree | ad2191d6a5ab623bee10549181a83b364ce749a8 | |
parent | b68c673d455fa04ea5aee0375350e8748039d70b (diff) | |
download | ofono-19187a0ee7acfbb91fac8d1be5c2a80ffb3f4028.tar.bz2 |
Properly skip over quoted values
Otherwise a left paren in a string can bring an obscure segfault.
-rw-r--r-- | gatchat/gatresult.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c index 3d07e132..688b26b3 100644 --- a/gatchat/gatresult.c +++ b/gatchat/gatresult.c @@ -361,6 +361,17 @@ static gint skip_until(const char *line, int start, const char delim) if (line[i] == delim) return i; + if (line[i] == '\"') { + i += 1; + while (i < len && line[i] != '\"') + i += 1; + + if (i < len) + i += 1; + + continue; + } + if (line[i] != '(') { i += 1; continue; |