All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] gatchat: Fix parsing fields with odd number of quotation marks
@ 2016-11-10  9:22 Kuba Pawlak
  2016-11-10  9:22 ` [PATCH 2/2] bluez5: fix crash on DBus transport disconnection Kuba Pawlak
  2016-11-10 16:18 ` [PATCH 1/2] gatchat: Fix parsing fields with odd number of quotation marks Denis Kenzior
  0 siblings, 2 replies; 3+ messages in thread
From: Kuba Pawlak @ 2016-11-10  9:22 UTC (permalink / raw)
  To: ofono

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

Events like +CLCC and +CCWA can have contact name attached to the
end of line. If this field contains odd number of quotation marks,
parser will eventually reject such message as malformatted.
---
 gatchat/gatsyntax.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/gatchat/gatsyntax.c b/gatchat/gatsyntax.c
index 800e35f..4d01ed7 100644
--- a/gatchat/gatsyntax.c
+++ b/gatchat/gatsyntax.c
@@ -309,6 +309,12 @@ static GAtSyntaxResult gsm_permissive_feed(GAtSyntax *syntax,
 		case GSM_PERMISSIVE_STATE_RESPONSE_STRING:
 			if (byte == '"')
 				syntax->state = GSM_PERMISSIVE_STATE_RESPONSE;
+			else if (byte == '\r') {
+				syntax->state = GSM_PERMISSIVE_STATE_IDLE;
+				i += 1;
+				res = G_AT_SYNTAX_RESULT_LINE;
+				goto out;
+			}
 			break;
 
 		case GSM_PERMISSIVE_STATE_GUESS_PDU:
-- 
2.5.5

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928


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

end of thread, other threads:[~2016-11-10 16:18 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-11-10  9:22 [PATCH 1/2] gatchat: Fix parsing fields with odd number of quotation marks Kuba Pawlak
2016-11-10  9:22 ` [PATCH 2/2] bluez5: fix crash on DBus transport disconnection Kuba Pawlak
2016-11-10 16:18 ` [PATCH 1/2] gatchat: Fix parsing fields with odd number of quotation marks 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.