diff options
| author | Miika Pekkarinen <miipekk@ihme.org> | 2006-05-27 11:21:08 +0000 |
|---|---|---|
| committer | Miika Pekkarinen <miipekk@ihme.org> | 2006-05-27 11:21:08 +0000 |
| commit | 196b770a96920e93dff514b9173d290bf73d0a81 (patch) | |
| tree | f8a972d7892fb2f152dc8d58a37f6dc7d41c7109 /apps/tagcache.c | |
| parent | 45975987b2a18b607c35e05aa7090f102246fdcc (diff) | |
| download | rockbox-196b770a96920e93dff514b9173d290bf73d0a81.zip rockbox-196b770a96920e93dff514b9173d290bf73d0a81.tar.gz rockbox-196b770a96920e93dff514b9173d290bf73d0a81.tar.bz2 rockbox-196b770a96920e93dff514b9173d290bf73d0a81.tar.xz | |
Init dircache after applying settings and use a splash. Possible prevent
some type of buffer overflow with tagcache.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@9997 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps/tagcache.c')
| -rw-r--r-- | apps/tagcache.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/apps/tagcache.c b/apps/tagcache.c index 127c6aa..f4e139a 100644 --- a/apps/tagcache.c +++ b/apps/tagcache.c @@ -1427,7 +1427,6 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) tempbufidx = 0; tempbuf_pos = TAGFILE_MAX_ENTRIES * sizeof(struct tempbuf_searchidx); - memset(tempbuf+tempbuf_pos, 0, LOOKUP_BUF_DEPTH * sizeof(void **)); tempbuf_pos += LOOKUP_BUF_DEPTH * sizeof(void **); tempbuf_left = tempbuf_size - tempbuf_pos - 8; if (tempbuf_left - TAGFILE_ENTRY_AVG_LENGTH * TAGFILE_MAX_ENTRIES < 0) @@ -1438,6 +1437,7 @@ static int build_index(int index_type, struct tagcache_header *h, int tmpfd) lookup = (struct tempbuf_searchidx **) (tempbuf + sizeof(struct tempbuf_searchidx)*TAGFILE_MAX_ENTRIES); + memset(lookup, 0, LOOKUP_BUF_DEPTH * sizeof(void **)); /* Open the index file, which contains the tag names. */ snprintf(buf, sizeof buf, TAGCACHE_FILE_INDEX, index_type); @@ -2024,7 +2024,7 @@ static bool allocate_tagcache(void) sizeof(struct ramcache_header) + TAG_COUNT*sizeof(void *); logf("tagcache: %d bytes allocated.", stat.ramcache_allocated); logf("at: 0x%04x", audiobuf); - audiobuf += (long)((stat.ramcache_allocated & ~0x03) + 0x04); + audiobuf += (long)((stat.ramcache_allocated & ~0x03) + 128); return true; } |