[MPlayer-dev-eng] [PATCH] Fix potential overflow in get_metadata
Clément Bœsch
ubitux at gmail.com
Sun Dec 19 15:05:37 CET 2010
On Sun, Dec 19, 2010 at 01:03:57PM +0100, Reimar Döffinger wrote:
> On Thu, Dec 16, 2010 at 11:07:00PM +0100, Clément Bœsch wrote:
> > char *get_metadata (metadata_t type) {
> > - char *meta = NULL;
> > + char meta[16];
>
> Please use something like 100, this one:
> "%d Hz, %d ch.", while not for valid values, in general
> can already expand to 36 bytes or so.
Applied, with 128.
> Seems ok otherwise, I was thinking about factoring out
> the strdup(meta) but I suspect it might be a bad idea.
Yes, I intentionally avoided the goto here.
--
Clément B.
Not sent from a jesusPhone.
More information about the MPlayer-dev-eng
mailing list