Closed Bug 1467759 Opened 2 years ago Closed 2 years ago

Escape all the property names in JSONWriter

Categories

(Core :: MFBT, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla62
Tracking Status
firefox62 --- fixed

People

(Reporter: Dexter, Assigned: Dexter)

References

Details

Attachments

(1 file)

As of now, JSONWriter only seems to properly escape the name of the properties for scalars. As a consequence, the following example would fail to be escaped and will produce an invalid JSON:

> { "some\path": 12 }

The fix should be trivial: using in |PropertyNameAndColon| [2] in [1].

[1] - https://searchfox.org/mozilla-central/rev/c621276fbdd9591f52009042d959b9e19b66d49f/mfbt/JSONWriter.h#315-319
[2] - https://searchfox.org/mozilla-central/rev/c621276fbdd9591f52009042d959b9e19b66d49f/mfbt/JSONWriter.h#271
Assignee: nobody → alessio.placitelli
Blocks: 1461965
Priority: -- → P1
Comment on attachment 8984535 [details]
Bug 1467759 - Escape all the property names in JSONWriter.

https://reviewboard.mozilla.org/r/250412/#review256984

Thanks!
Attachment #8984535 - Flags: review?(nfroyd) → review+
Pushed by alessio.placitelli@gmail.com:
https://hg.mozilla.org/integration/autoland/rev/faeec6285083
Escape all the property names in JSONWriter. r=froydnj
https://hg.mozilla.org/mozilla-central/rev/faeec6285083
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla62
You need to log in before you can comment on or make changes to this bug.