diff options
author | Nils Wallménius <nils@rockbox.org> | 2009-08-06 19:02:59 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2009-08-06 19:02:59 +0000 |
commit | c80f6dad303da248d7fe7d1acbe5916a06e3f73d (patch) | |
tree | bb9c1918c50266e4368ed53926b17daea9c2a3ea | |
parent | 2cab3116356e377fe0c3073ce679b69478553565 (diff) | |
download | rockbox-c80f6dad303da248d7fe7d1acbe5916a06e3f73d.tar.gz rockbox-c80f6dad303da248d7fe7d1acbe5916a06e3f73d.zip |
Fix out of bounds accesses in keybox and matrix
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@22191 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/plugins/keybox.c | 2 | ||||
-rw-r--r-- | 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) | |||
182 | for (i = 0; i < MAX_ENTRIES && pw_list.entries[i].used; i++) | 182 | for (i = 0; i < MAX_ENTRIES && pw_list.entries[i].used; i++) |
183 | ; | 183 | ; |
184 | 184 | ||
185 | if (pw_list.entries[i].used) | 185 | if (MAX_ENTRIES == i) |
186 | { | 186 | { |
187 | rb->splash(HZ, "Password list full"); | 187 | rb->splash(HZ, "Password list full"); |
188 | return; | 188 | 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) | |||
283 | 283 | ||
284 | if (i > ROWS) { | 284 | if (i > ROWS) { |
285 | matrix[z][j].val = 129; | 285 | matrix[z][j].val = 129; |
286 | matrix[ROWS][j].bold = 1; | 286 | matrix[ROWS - 1][j].bold = 1; |
287 | matrix_blit_char(z - 1, j, matrix[z][j].val); | 287 | matrix_blit_char(z - 1, j, matrix[z][j].val); |
288 | continue; | 288 | continue; |
289 | } | 289 | } |