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:
parent
08003904d7
commit
fc4868a040
@ -421,6 +421,8 @@ MpdTag *apeDup(char *file)
|
|||||||
|
|
||||||
/* read tag into buffer */
|
/* read tag into buffer */
|
||||||
tagLen -= sizeof(footer);
|
tagLen -= sizeof(footer);
|
||||||
|
if (tagLen <= 0)
|
||||||
|
goto fail;
|
||||||
buffer = xmalloc(tagLen);
|
buffer = xmalloc(tagLen);
|
||||||
if (fread(buffer, 1, tagLen, fp) != tagLen)
|
if (fread(buffer, 1, tagLen, fp) != tagLen)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
Loading…
Reference in New Issue
Block a user