From 5afdcdd46043481675a48891a071dbb1fea1ab4c Mon Sep 17 00:00:00 2001 From: William Wilgus Date: Tue, 24 Sep 2019 23:40:38 -0500 Subject: Bug fix icon.c crashes with negative icon index The index for Icon_NOICON is -1 which is caught properly as is icon > Icon_Last_Themeable But if you pass an index lower than Icon_NOICON screen_put_iconxy() tries to read memory prior to the iconset resulting in a crash Change-Id: I415e650932d65214d883a1595e22261f22e776b6 --- apps/gui/icon.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'apps/gui') diff --git a/apps/gui/icon.c b/apps/gui/icon.c index c20f1fe09a..db3ae2c96b 100644 --- a/apps/gui/icon.c +++ b/apps/gui/icon.c @@ -107,7 +107,7 @@ void screen_put_iconxy(struct screen * display, const int is_rtl = lang_is_rtl(); const struct bitmap *iconset; - if (icon == Icon_NOICON) + if (icon <= Icon_NOICON) { if (is_rtl) xpos = display->getwidth() - xpos - width; -- cgit v1.2.3