]> git.baikalelectronics.ru Git - uboot.git/commit
autoboot: fix illegal memory access when stop key and delay key are empty
authorYuezhang.Mo@sony.com <Yuezhang.Mo@sony.com>
Fri, 15 Jan 2021 03:11:49 +0000 (03:11 +0000)
committerTom Rini <trini@konsulko.com>
Wed, 27 Jan 2021 22:07:48 +0000 (17:07 -0500)
commit2c400e63f9c5a88281f0331a0550b9c6c530c6fd
treeb7f1b41c94c9c635682786cee5c5a1c9cd9e2d8d
parentca6aac884109fee1a7cda80c7da34246bdba9e23
autoboot: fix illegal memory access when stop key and delay key are empty

If both stop key and delay key are empty, the length of these
keys is 0. The subtraction operation will cause the u_int type
variable to overflow, will cause illegal memory access in key
input loop.

This commit fixes this bug by using int type instead of u_init.
Acked-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
common/autoboot.c