diff options
author | Andrzej Zaborowski <andrew.zaborowski@intel.com> | 2009-11-10 07:31:31 +0100 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2009-11-10 20:36:36 +0100 |
commit | 9de3ae56a4cfa30d400436e4e790b1db2ba5a4f2 (patch) | |
tree | 72c20f8ff83d61188c933d98844a989f7c9c4dbb | |
parent | 27c1183a14b6eef1738069af3d98e59ba2cdd519 (diff) | |
download | connman-9de3ae56a4cfa30d400436e4e790b1db2ba5a4f2.tar.gz connman-9de3ae56a4cfa30d400436e4e790b1db2ba5a4f2.tar.bz2 connman-9de3ae56a4cfa30d400436e4e790b1db2ba5a4f2.zip |
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; |