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
This commit is contained in:
J. Alexander Treuman 2006-11-26 03:51:46 +00:00
parent 08003904d7
commit fc4868a040

View File

@ -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;