All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Properly skip over quoted values
@ 2009-11-10  6:31 Andrzej Zaborowski
  2009-11-10 18:54 ` Denis Kenzior
  0 siblings, 1 reply; 3+ messages in thread
From: Andrzej Zaborowski @ 2009-11-10  6:31 UTC (permalink / raw)
  To: ofono

[-- Attachment #1: Type: text/plain, Size: 668 bytes --]

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


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2009-11-10 19:00 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-10  6:31 [PATCH] Properly skip over quoted values Andrzej Zaborowski
2009-11-10 18:54 ` Denis Kenzior
2009-11-10 19:00   ` Denis Kenzior

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.