[MPlayer-dev-eng] [PATCH] fix SAMI parsing

hyc at highlandsun.com hyc at highlandsun.com
Mon Jun 7 01:24:46 CEST 2010


On Mon, Jun 07, 2010 at 12:26:33AM +0200, Reimar D?ffinger wrote:
> On Sun, Jun 06, 2010 at 02:51:29PM -0700, Howard Chu wrote:
> 
> > +		uint32_t c = strtol(s+2, &s, 0);
> > +		uint8_t tmp;
> > +		PUT_UTF8(c, tmp, *p++ = tmp;)
> > +		if (*s == ';') s++; }
> 
> I'm sorry, but I think you'll have to somehow "prove"
> this is not a security issue.
> Checking and documenting that PUT_UTF8 will never write
> more than we read might be possible.
> Or just "blindly" checking we still have at least 8 bytes
> free should do as well.

Not necessary. Decimal numbers encode only 3.25 bits per byte, while UTF-8 encodes 7 bits per byte. This conversion will always fit.



More information about the MPlayer-dev-eng mailing list