From c80f6dad303da248d7fe7d1acbe5916a06e3f73d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nils=20Wallm=C3=A9nius?= Date: Thu, 6 Aug 2009 19:02:59 +0000 Subject: [PATCH] Fix out of bounds accesses in keybox and matrix git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22191 a1c6a512-1295-4272-9138-f99709370657 --- apps/plugins/keybox.c | 2 +- apps/plugins/matrix.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/plugins/keybox.c b/apps/plugins/keybox.c index 448050938f..6c59470fa4 100644 --- a/apps/plugins/keybox.c +++ b/apps/plugins/keybox.c @@ -182,7 +182,7 @@ static void add_entry(int selected_item) for (i = 0; i < MAX_ENTRIES && pw_list.entries[i].used; i++) ; - if (pw_list.entries[i].used) + if (MAX_ENTRIES == i) { rb->splash(HZ, "Password list full"); return; diff --git a/apps/plugins/matrix.c b/apps/plugins/matrix.c index 84a333e1fb..12ec4e9093 100644 --- a/apps/plugins/matrix.c +++ b/apps/plugins/matrix.c @@ -283,7 +283,7 @@ static void matrix_loop(void) if (i > ROWS) { matrix[z][j].val = 129; - matrix[ROWS][j].bold = 1; + matrix[ROWS - 1][j].bold = 1; matrix_blit_char(z - 1, j, matrix[z][j].val); continue; }