]> git.dujemihanovic.xyz Git - u-boot.git/commit
log: correct and check array size of log categories
authorHeinrich Schuchardt <xypron.glpk@gmx.de>
Fri, 23 Oct 2020 11:00:01 +0000 (13:00 +0200)
committerTom Rini <trini@konsulko.com>
Tue, 27 Oct 2020 21:04:15 +0000 (17:04 -0400)
commit2a0cbf3bca372dcbc79048d475c817d4e462069e
tree4f12560f10151c4fe5b7bb2a58e2b04bee035f45
parent920157678b863bc34b655212a4bc0d29f84b4a80
log: correct and check array size of log categories

The log command has led to NULL dereferences if an unknown category name
name was used due to missing entries in the list of category names.

Add compile time checks for the array sizes of log_cat_name and
log_lvl_name to avoid future mishaps.

Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
common/log.c