Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(32)

Issue 2823023002: Do not silently drop \u0000 in base::JSONReader (Closed)

Created:
3 years, 8 months ago by Reilly Grant (use Gerrit)
Modified:
3 years, 8 months ago
CC:
chromium-reviews, danakj+watch_chromium.org, vmpstr+watch_chromium.org
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Do not silently drop \u0000 in base::JSONReader When encoding a string containing nul bytes base::JSONWriter will emit the Unicode escape sequence "\u0000" which is valid JSON. base::JSONReader however supports the nonstandard "\x00" escape sequence but will silently drop the character "\u0000". This patch fixes JSONParser::DecodeUTF16() properly append nul bytes to the output string. BUG=268991 Review-Url: https://codereview.chromium.org/2823023002 Cr-Commit-Position: refs/heads/master@{#465018} Committed: https://chromium.googlesource.com/chromium/src/+/686319f537227990eb77e717897691bcb7171187

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -3 lines) Patch
M base/json/json_parser.cc View 1 chunk +1 line, -1 line 0 comments Download
M base/json/json_reader_unittest.cc View 1 chunk +2 lines, -2 lines 0 comments Download

Messages

Total messages: 15 (9 generated)
Reilly Grant (use Gerrit)
PTAL
3 years, 8 months ago (2017-04-17 20:37:27 UTC) #6
Mark Mentovai
LGTM, but +rsesek too. He wrote this parser, if this handling of \u0000 was intentional, ...
3 years, 8 months ago (2017-04-17 21:06:50 UTC) #8
Robert Sesek
LGTM
3 years, 8 months ago (2017-04-17 21:09:33 UTC) #9
Reilly Grant (use Gerrit)
Thanks. There is also likely some optimization to be done because DecodeUTF16 builds a temporary ...
3 years, 8 months ago (2017-04-17 21:10:11 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2823023002/1
3 years, 8 months ago (2017-04-17 21:10:40 UTC) #12
commit-bot: I haz the power
3 years, 8 months ago (2017-04-17 21:14:14 UTC) #15
Message was sent while issue was closed.
Committed patchset #1 (id:1) as
https://chromium.googlesource.com/chromium/src/+/686319f537227990eb77e7178976...

Powered by Google App Engine
This is Rietveld 408576698