summaryrefslogtreecommitdiff
path: root/apps/plugins
diff options
context:
space:
mode:
authorTomer Shalev <shalev.tomer@gmail.com>2010-04-07 17:06:32 +0000
committerTomer Shalev <shalev.tomer@gmail.com>2010-04-07 17:06:32 +0000
commiteeb0c088feaff6d2730b485cd17fab8cbc45a787 (patch)
treee19db7ad61a8e3e1bbbb2c32c9761f2605bca147 /apps/plugins
parent1709d72eb476ac41407a76fab1bc4701a5c513bc (diff)
Text viewer: Fix possible memory corruption
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25510 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/plugins')
-rw-r--r--apps/plugins/viewer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c
index e8d6116eb6..cefc83beb2 100644
--- a/apps/plugins/viewer.c
+++ b/apps/plugins/viewer.c
@@ -1011,7 +1011,7 @@ static void fill_buffer(long pos, unsigned char* buf, unsigned size)
if (offset == 0 && prefs.encoding == UTF_8 && is_bom)
rb->lseek(fd, BOM_SIZE, SEEK_SET);
- numread = rb->read(fd, buf, size);
+ numread = rb->read(fd, buf, size - 1);
buf[numread] = 0;
rb->button_clear_queue(); /* clear button queue */