Closed
Bug 823816
Opened 12 years ago
Closed 12 years ago
B2G MMS: WSP Text decode check the wrong range of ASCII code.
Categories
(Core :: DOM: Device Interfaces, defect)
Tracking
()
People
(Reporter: ctai, Assigned: ctai)
References
Details
Attachments
(2 files, 2 obsolete files)
3.87 KB,
patch
|
vicamo
:
review+
|
Details | Diff | Splinter Review |
3.88 KB,
patch
|
Details | Diff | Splinter Review |
WspPduHelper parse the decodeConstrainedMedia like 0x9d813100 will cause wrong result=>WspPduHelper: contentType = {"media":"1","params":null}
The root cause is the wrong range of ASCII in Text.decode.
After change the range check statement from "if ((code >= CTLS) && (code != DEL)) {" to "if ((code >= CTLS) && (code <= DEL)) {", I can fix the bug.
It shows the correct result like "WspPduHelper: contentType = {"media":"image/gif","params":null}".
Assignee | ||
Comment 1•12 years ago
|
||
Attachment #694690 -
Flags: review?(vyang)
Comment 2•12 years ago
|
||
Comment on attachment 694690 [details] [diff] [review]
Fix the wrong ASCII range
Review of attachment 694690 [details] [diff] [review]:
-----------------------------------------------------------------
It's not. RFC-2616 has following definitions clearly:
OCTET = <any 8-bit sequence of data>
TEXT = <any OCTET except CTLs, but including LWS>
So TEXT can definitely be non-ASCII, 8-bit characters. Instead, BNF of Extension-media should be:
Extension-media = Text-string
to solve this case perfectly. However, I can't find any update to WAP-230-WSP-20010705-a now. Another solution would be try decoding ShortInteger before NullTerminatedTexts as Android does. Again, that's not specified in WSP spec.
Attachment #694690 -
Flags: review?(vyang) → review-
Comment 3•12 years ago
|
||
I don't think this issue should ever block bug 801632.
Assignee | ||
Comment 4•12 years ago
|
||
Please see below codes for how Android dealing this issue for reference.
In function "parseContentType" in frameworks/opt/mms/src/java/com/google/android/mms/pdu/PduParser.java shows
if ((first >= TEXT_MIN) && (first <= TEXT_MAX)) {
contentType = parseWapString(pduDataStream, TYPE_TEXT_STRING);
} else if (first > TEXT_MAX) {
int index = parseShortInteger(pduDataStream);
....
}
Android check the first char to decide taking as WapString or ShortInteger. Maybe we can consider this method.
Assignee | ||
Comment 5•12 years ago
|
||
Attachment #694690 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #694732 -
Flags: review?(vyang)
Comment 6•12 years ago
|
||
Comment on attachment 694732 [details] [diff] [review]
Replace NullTerminatedTexts witn TextString
Review of attachment 694732 [details] [diff] [review]:
-----------------------------------------------------------------
Thank you! But since this is a non-standard solution, we should also update comments for |this.ConstrainedEncoding|.
::: dom/mms/src/ril/WspPduHelper.jsm
@@ +881,5 @@
> *
> * @return Decode integer value or string.
> */
> decode: function decode(data) {
> + return decodeAlternatives(data, null, TextString, ShortInteger);
Could you also updates encode()? TypeValue.encode() should call ConstrainedEncoding.encode(), and ConstrainedEncoding.encode() should either call ShortInteger.encode() or TextString.encode().
Attachment #694732 -
Flags: review?(vyang)
Assignee | ||
Comment 7•12 years ago
|
||
Attachment #694732 -
Attachment is obsolete: true
Assignee | ||
Updated•12 years ago
|
Attachment #695408 -
Flags: review?(vyang)
Comment 8•12 years ago
|
||
Comment on attachment 695408 [details] [diff] [review]
Replace NullTerminatedTexts witn TextString
Review of attachment 695408 [details] [diff] [review]:
-----------------------------------------------------------------
\(^^)/
Attachment #695408 -
Flags: review?(vyang) → review+
Assignee | ||
Comment 9•12 years ago
|
||
Try server...
https://tbpl.mozilla.org/?tree=Try&rev=2628f2117a02
Assignee | ||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 10•12 years ago
|
||
Updated•12 years ago
|
Keywords: checkin-needed
Comment 11•12 years ago
|
||
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Flags: in-testsuite+
Resolution: --- → FIXED
Target Milestone: --- → mozilla20
Updated•12 years ago
|
blocking-b2g: leo? → leo+
Assignee | ||
Comment 13•12 years ago
|
||
Comment 14•12 years ago
|
||
status-b2g18:
--- → fixed
status-b2g18-v1.0.0:
--- → wontfix
status-b2g18-v1.0.1:
--- → wontfix
status-firefox20:
--- → fixed
Comment 15•12 years ago
|
||
The entire set of clian's pushes was backed out for multiple reasons.
https://tbpl.mozilla.org/?tree=Mozilla-B2g18&rev=a0b06192f882
1.) The tree rules are clear that you are not to land on top of bustage. At the time you pushed, both B2G Mn and B2G xpcshell had bustage from prior commits that hadn't been backed out yet.
2.) The tree rules are also clear that you are to watch your pushes for any bustage and handle them accordingly. mozilla-inbound is the ONLY tree where this rule does not apply.
3.) Even after the earlier bustage was backed out, something in one of your many pushes was causing further B2G Mn failures as shown in the log below.
https://tbpl.mozilla.org/php/getParsedLog.php?id=20424173&tree=Mozilla-B2g18
4.) This isn't cause for backout by itself, but it is also strongly preferred to not push each commit individually as our build and testing resources are limited and doing so stretches them even thinner. Please limit your number of pushes as much as possible unless you have good reason for keeping them separate.
Comment 16•12 years ago
|
||
Updated•12 years ago
|
Flags: in-moztrap-
You need to log in
before you can comment on or make changes to this bug.
Description
•