Closed Bug 1356905 Opened 9 years ago Closed 9 years ago

Record serialization incorrectly escapes control characters

Categories

(Firefox for iOS :: Sync, enhancement)

All
iOS
enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
Tracking Status
fxios 7.3 ---
fxios-v7.0 --- affected
fxios-v7.1 --- affected
fxios-v7.2 --- affected

People

(Reporter: rnewman, Assigned: rnewman)

References

Details

(Whiteboard: [MobileCore])

Attachments

(1 file)

55 bytes, text/x-github-pull-request
sleroux
: review+
Details | Review
This is the root cause of Bug 1354935 -- Firefox for iOS 7.x doesn't correctly escape some unicode characters. I hit this thanks to a vertical tab (char code 11) in an old history record in my profile; my iPad uploaded the old record to the server, and my phone crashed. I've written a failing round-trip test.
A failing assertion: open func serializer<T: CleartextPayloadJSON>(_ f: @escaping (T) -> JSON) -> (Record<T>) -> JSON? { return { (record: Record<T>) -> JSON? in let json = f(record.payload) let data = (json.rawString([writtingOptionsKeys.castNilToNSNull: true]) ?? "").utf8EncodedData assert(!JSON(data).isNull())
Attached file PR
Assignee: nobody → rnewman
Status: NEW → ASSIGNED
Attachment #8858663 - Flags: review?(sarentz)
Comment on attachment 8858663 [details] [review] PR Adding two more reviewers since I don't have a ton of time today.
Attachment #8858663 - Flags: review?(sleroux)
Attachment #8858663 - Flags: review?(jdarcangelo)
Attachment #8858663 - Flags: review?(sleroux) → review+
Blocks: 1354935
Whiteboard: [needsuplift]
master 5d347f81e7fa0386be7e2423ec5d99237de06531 v7.x a09e460
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Whiteboard: [needsuplift] → [MobileCore]
Attachment #8858663 - Flags: review?(sarentz)
Attachment #8858663 - Flags: review?(jdarcangelo)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: