base: reject nonsense JSON starting with '/'.

When trying to consume comments, the JSON parser would, upon seeing a
'/', consume two bytes and ignore them if they didn't match the pattern
of a comment (i.e. "//" or "/*"). This lead to the first two bytes of
"/33" being ignored as a “comment” and the remainder ("3") parsing as
the value three.

Change-Id: I3bbcb7e608960ff7edf62a21767f0caa35cccfd0
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1999328
Reviewed-by: Robert Sesek <rsesek@chromium.org>
Commit-Queue: Adam Langley <agl@chromium.org>
Cr-Commit-Position: refs/heads/master@{#731468}
2 files changed