diff options
| author | Tomer Shalev <shalev.tomer@gmail.com> | 2010-04-07 17:06:32 +0000 |
|---|---|---|
| committer | Tomer Shalev <shalev.tomer@gmail.com> | 2010-04-07 17:06:32 +0000 |
| commit | eeb0c088feaff6d2730b485cd17fab8cbc45a787 (patch) | |
| tree | e19db7ad61a8e3e1bbbb2c32c9761f2605bca147 /apps/plugins/viewer.c | |
| parent | 1709d72eb476ac41407a76fab1bc4701a5c513bc (diff) | |
| download | rockbox-eeb0c088feaff6d2730b485cd17fab8cbc45a787.zip rockbox-eeb0c088feaff6d2730b485cd17fab8cbc45a787.tar.gz rockbox-eeb0c088feaff6d2730b485cd17fab8cbc45a787.tar.bz2 rockbox-eeb0c088feaff6d2730b485cd17fab8cbc45a787.tar.xz | |
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/viewer.c')
| -rw-r--r-- | apps/plugins/viewer.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/plugins/viewer.c b/apps/plugins/viewer.c index e8d6116..cefc83b 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 */ |