From: Patrick Smits Date: Thu, 1 May 2008 18:47:38 +0000 (+0200) Subject: ignore "ALBUM ARTIST" Ogg tag X-Git-Tag: v0.42~4 X-Git-Url: http://royale.zerezo.com/git/?a=commitdiff_plain;h=e7cff14b8d57de284b9dc9836b9c324580cac759;p=FAPG ignore "ALBUM ARTIST" Ogg tag Hi Antoine, I've found a bug in FAPG version 0.41. If an .ogg file has a tag "ALBUM ARTIST", the program will crash. The tag is detected and processed as a normal "ARTIST" tag, however with an incorrect (huge) length. This causes a buffer overflow in the strncpy to the artist buffer. I've created a patch which adds a check on the "ALBUM ARTIST" tag (only for .ogg) before the check on the "ARTIST" tag. I've tested it locally and it seems to do the job. Kind Regards, Patrick Smits Signed-off-by: Antoine Jacquet --- diff --git a/fapg.c b/fapg.c index 176c495..38a27bf 100644 --- a/fapg.c +++ b/fapg.c @@ -862,6 +862,13 @@ void parse_ogg(unsigned char *file) title[size - 6] = '\0'; c += size; } + if(strncasecmp(c, "ALBUM ARTIST=", 13) == 0) { + // ignore tag + size = + *(c - 4) + (*(c - 3) << 8) + (*(c - 2) << 16) + + (*(c - 1) << 24); + c += size; + } if(strncasecmp(c, "ARTIST=", 7) == 0) { size = *(c - 4) + (*(c - 3) << 8) + (*(c - 2) << 16) +