diff options
author | Eric Yilun Lin <yllin@chromium.org> | 2021-01-11 13:59:21 +0800 |
---|---|---|
committer | Commit Bot <commit-bot@chromium.org> | 2021-01-11 07:09:57 +0000 |
commit | bfd9274c3c5115663782712ded8194f720e3ff32 (patch) | |
tree | 6187db03aee317c04c89e8ca5f6a43c85d8df22b /common | |
parent | 6625f7173bcb4f33a1c92b549fa82b6c6e026664 (diff) | |
download | chrome-ec-bfd9274c3c5115663782712ded8194f720e3ff32.tar.gz |
crash: fix unsigned div-by-zero crash
The bug was introduced in chromium:1834603
BUG=chromium:984041
TEST=ensure crash udivzero is triggered
BRANCH=none
Change-Id: I83d7465d1bbe41976c78c7d298abdafd3670e8cd
Signed-off-by: Eric Yilun Lin <yllin@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/ec/+/2620725
Reviewed-by: Ting Shen <phoenixshen@chromium.org>
Diffstat (limited to 'common')
-rw-r--r-- | common/panic_output.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/common/panic_output.c b/common/panic_output.c index 75c94223ce..a3f34e6d47 100644 --- a/common/panic_output.c +++ b/common/panic_output.c @@ -324,7 +324,7 @@ static int command_crash(int argc, char **argv) volatile int zero = 0; cflush(); - ccprintf("%08x", 1 / zero); + ccprintf("%08x", 1U / zero); #ifdef CONFIG_CMD_STACKOVERFLOW } else if (!strcasecmp(argv[1], "stack")) { stack_overflow_recurse(1); |