Nick Pelly
8457b0f0c6
Fix Phone App crash due to binary data in HSP/HFP stream.
The BMW 2005 E46 sends binary data amongst the AT commands. Log below.
There were a couple of problems when this happened.
o Off by one error causing overflow of read buffer.
o No validation that input can be parsed by NewStringUTF()
This commit fixes the off-by-one, and validates that the input is ASCII.
I also increased the read buffer size to 256 to make it less likely we split
commands across buffers. We will lose the command when this happens.
2010-03-24 16:00:29.934185 > ACL data: handle 1 flags 0x02 dlen 17
L2CAP(d): cid 0x0040 len 13 [psm 0]
0000: 29 ef 13 41 54 2b 43 49 4e 44 3f 0d 6a )ï.AT+CIND?.j
2010-03-24 16:00:29.940502 < ACL data: handle 1 flags 0x00 dlen 38
0000: 22 00 40 00 2b ef 3d 0d 0a 2b 43 49 4e 44 3a 20 ".@.+ï=..+CIND:
0010: 31 2c 30 2c 30 2c 30 2c 34 2c 30 2c 35 0d 0a 0d 1,0,0,0,4,0,5...
0020: 0a 4f 4b 0d 0a b0 .OK..°
2010-03-24 16:00:29.949657 > HCI Event: Number of Completed Packets (0x13) plen 5
handle 1 packets 1
2010-03-24 16:00:30.004284 > ACL data: handle 1 flags 0x02 dlen 9
L2CAP(d): cid 0x0040 len 5 [psm 0]
0000: 29 ff 01 01 76 )ÿ..v
2010-03-24 16:00:30.137218 > ACL data: handle 1 flags 0x02 dlen 144
L2CAP(d): cid 0x0040 len 140 [psm 0]
0000: 29 ef 0e 01 02 a9 03 58 02 a9 03 64 02 a9 03 98 )ï...©.X.©.d.©..
0010: 02 a9 03 98 02 a9 03 98 02 a9 03 98 02 a9 03 98 .©...©...©...©..
0020: 02 a9 03 98 02 a9 03 98 02 a9 03 98 02 a9 03 98 .©...©...©...©..
0030: 02 a9 04 d8 02 a9 03 a4 02 a9 03 b0 02 a9 03 bc .©.Ø.©.¤.©.°.©.¼
0040: 02 a9 03 c8 02 a9 03 fc 02 a9 04 38 02 a9 04 44 .©.È.©.ü.©.8.©.D
0050: 02 a9 04 50 02 a9 04 84 02 a9 04 90 02 a9 04 9c .©.P.©...©...©..
0060: 02 a9 04 a8 02 a9 04 b4 02 a9 04 c0 02 a9 04 d8 .©.¨.©.´.©.À.©.Ø
0070: 02 a9 04 d8 02 a9 04 cc 02 a9 10 7c 02 a9 10 d8 .©.Ø.©.Ì.©.|.©.Ø
0080: 02 a9 10 e4 02 a9 10 f4 02 a9 11 6a .©.ä.©.ô.©.j
Change-Id: I7ccff70bc95a7945d8ff03527764fd8f4da04d24
Bug: 2539053
2010-03-25 09:56:01 -07:00
..
2010-03-10 13:11:47 -05:00
2009-11-13 13:53:39 -08:00
2010-03-05 16:27:15 -08:00
2010-03-05 18:26:41 -08:00
2010-03-05 16:27:15 -08:00
2010-03-05 18:26:41 -08:00
2009-03-09 11:52:12 -07:00
2009-11-13 13:53:39 -08:00
2009-11-13 13:53:39 -08:00
2009-11-13 13:53:39 -08:00
2010-03-25 09:56:01 -07:00
2010-03-19 13:50:56 -07:00
2009-11-13 13:53:39 -08:00
2009-11-20 14:09:24 -08:00
2010-03-18 11:41:25 -07:00
2010-03-11 11:38:31 -08:00
2010-02-18 10:13:11 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-11-13 13:53:39 -08:00
2010-02-18 15:32:47 -08:00
2010-02-11 13:16:22 -08:00
2010-01-08 15:46:24 -05:00
2010-03-07 09:29:15 -05:00
2010-03-15 07:47:05 -07:00
2010-01-25 14:00:10 -08:00
2009-11-13 13:53:39 -08:00
2009-03-24 18:46:20 -07:00
2009-11-13 13:53:39 -08:00
2009-03-03 19:31:44 -08:00
2009-10-01 17:50:23 -07:00
2009-11-13 13:53:39 -08:00
2009-11-13 13:53:39 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-07-21 11:16:54 -07:00
2009-05-20 11:28:04 -07:00
2009-12-09 16:34:46 +08:00
2009-12-09 16:34:46 +08:00
2009-12-09 16:34:33 +08:00
2009-11-13 13:53:39 -08:00
2009-03-03 19:31:44 -08:00
2010-01-04 09:54:45 -08:00
2009-05-20 11:28:04 -07:00
2010-01-12 07:57:42 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-11-13 13:53:39 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2010-02-16 13:21:05 -08:00
2010-03-22 15:55:38 -07:00
2010-03-09 16:51:09 -08:00
2010-02-24 18:20:54 -08:00
2010-02-17 08:46:04 -08:00
2010-02-16 12:16:48 -08:00
2009-03-03 19:31:44 -08:00
2010-03-04 11:52:14 -08:00
2009-12-07 19:11:14 -08:00
2009-11-13 13:53:39 -08:00
2010-01-07 00:28:58 -08:00
2010-02-18 07:09:06 -05:00
2009-03-03 19:31:44 -08:00
2010-03-01 09:07:37 -08:00
2009-12-07 19:11:14 -08:00
2010-02-23 10:02:20 -08:00
2009-03-03 19:31:44 -08:00
2010-02-11 13:16:22 -08:00
2010-03-23 15:31:21 -07:00
2009-03-03 19:31:44 -08:00
2010-02-24 18:20:54 -08:00
2010-03-01 14:08:49 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2010-02-11 13:16:22 -08:00
2010-01-28 20:28:32 +08:00
2010-01-29 16:54:04 -08:00
2010-01-29 16:54:04 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-03-03 19:31:44 -08:00
2009-07-21 11:16:54 -07:00
2009-07-21 11:16:54 -07:00