ref: ff1feb148dfb5f887f34b56536d2004ba8eb3a8b
parent: be9670c51e39ac12eb42dabb0ff30831f0d47401
author: Jacob Moody <[email protected]>
date: Sun Dec 15 15:44:34 EST 2019
Increase vorbis buffer size, and catch large comments
--- a/vorbis.c
+++ b/vorbis.c
@@ -36,7 +36,7 @@
parsevorbismeta(int fd, uvlong offset, VorbisMeta *v)
{
u32int size;
- uchar buf[1024];
+ uchar buf[4096];
uint i;
char *sep;
@@ -54,6 +54,9 @@
for(i=0;i<v->ncom;i++){
pread(fd, buf, 4, offset);
size = lebtoi(buf, 4);
+ /* TODO: We should ignore large comments, and trim those that we dont use */
+ if(size >= sizeof buf)
+ sysfatal("parsevorbismeta: comment greater then buff size");
offset+=4;
pread(fd, buf, size, offset);