[PATCH] Properly skip over quoted values

Andrzej Zaborowski andrew.zaborowski at intel.com
Mon Nov 9 22:31:31 PST 2009


Otherwise a left paren in a string can bring an obscure segfault.
---
 gatchat/gatresult.c |   11 +++++++++++
 1 files changed, 11 insertions(+), 0 deletions(-)

diff --git a/gatchat/gatresult.c b/gatchat/gatresult.c
index 3d07e13..688b26b 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;
-- 
1.6.1



More information about the ofono mailing list