diff options
author | Jett Rink <jettrink@chromium.org> | 2019-02-13 16:59:36 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2019-02-14 05:27:30 -0800 |
commit | 16d77d2f44cf2c145625371c35f876931a00a552 (patch) | |
tree | 27b0cf21394123d8fe7998fb4692e8ae24cc168a /chip/ish/ipc_heci.c | |
parent | 69e7d371ff0508740a506c9a9b52c03d35ae94cc (diff) | |
download | chrome-ec-16d77d2f44cf2c145625371c35f876931a00a552.tar.gz |
cleanup: do not try to copy to/from NULL
If we receive an unsupported protocol in the ISH, we should not try to
dereference a NULL ptr.
BRANCH=none
BUG=none
TEST=builds
Change-Id: I4861385c30a94496026c1918d41a18ca82f3c740
Signed-off-by: Jett Rink <jettrink@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/1470897
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'chip/ish/ipc_heci.c')
-rw-r--r-- | chip/ish/ipc_heci.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/chip/ish/ipc_heci.c b/chip/ish/ipc_heci.c index 33e33f1717..e336994936 100644 --- a/chip/ish/ipc_heci.c +++ b/chip/ish/ipc_heci.c @@ -374,7 +374,8 @@ static int ipc_get_protocol_data(const struct ipc_if_ctx *ctx, break; } - memcpy(dest, src, payload_size); + if (src && dest) + memcpy(dest, src, payload_size); return len; } |