aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJ. Alexander Treuman <jat@spatialrift.net>2006-11-26 03:51:46 +0000
committerJ. Alexander Treuman <jat@spatialrift.net>2006-11-26 03:51:46 +0000
commitfc4868a04006d6ed755c7d4928267973e3f42596 (patch)
tree09fc946e4c367fc38c9753be03d838ff6ab8add0 /src
parent08003904d7af58c0402b49805b9f87b3d9ebbc27 (diff)
downloadmpd-fc4868a04006d6ed755c7d4928267973e3f42596.tar.gz
mpd-fc4868a04006d6ed755c7d4928267973e3f42596.tar.xz
mpd-fc4868a04006d6ed755c7d4928267973e3f42596.zip
Check that the APE tag length is valid before allocating a buffer for it.
git-svn-id: https://svn.musicpd.org/mpd/trunk@5098 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/tag.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/tag.c b/src/tag.c
index 276aeebec..8137347a8 100644
--- a/src/tag.c
+++ b/src/tag.c
@@ -421,6 +421,8 @@ MpdTag *apeDup(char *file)
/* read tag into buffer */
tagLen -= sizeof(footer);
+ if (tagLen <= 0)
+ goto fail;
buffer = xmalloc(tagLen);
if (fread(buffer, 1, tagLen, fp) != tagLen)
goto fail;