aboutsummaryrefslogtreecommitdiffhomepage
path: root/modules/skjson/src/FuzzSkJSON.cpp
diff options
context:
space:
mode:
authorGravatar Florin Malita <fmalita@chromium.org>2018-06-14 13:56:53 -0400
committerGravatar Skia Commit-Bot <skia-commit-bot@chromium.org>2018-06-14 18:23:47 +0000
commit28f5dd8a4c8aa053f417bcf7f1da94daa8915ca9 (patch)
treed08702c8ad797b215c70e525b6b038d923b4342c /modules/skjson/src/FuzzSkJSON.cpp
parentfc792b8718cc30e9da62c9559b23c1baac3166bb (diff)
[skjson] Fix ASAN undefined behavior
ASAN opines that a nullptr memcpy dest is undefined behavior, even when n == 0. ASAN may be right. This doesn't occur internally, in the parser, but can be triggered with the DOM builder API (as do some tests currently). We could say "don't do that", but if someone wants to build an empty string/array/object, it's kind of awkward to force them to provide a valid source pointer instead of simply e.g. Array(nullptr, 0). So let's guard for this case to make ASAN happy. Change-Id: If12e39f5eb8b273f22bbb0b5fce3321bf6482173 Reviewed-on: https://skia-review.googlesource.com/134944 Reviewed-by: Mike Klein <mtklein@google.com> Commit-Queue: Florin Malita <fmalita@chromium.org>
Diffstat (limited to 'modules/skjson/src/FuzzSkJSON.cpp')
0 files changed, 0 insertions, 0 deletions