Gnome interface seg-fault bug-fix.

Shane Harper shanegh at optusnet.com.au
Mon Apr 30 03:10:43 CEST 2001


Stéphane Borel wrote:
> 
> On Sat, Apr 28, 2001 at 09:51:28PM +1000, Shane Harper wrote:
> > Hi.
> >
> > Can someone please change all occurrences of
> >       char                psz_name[10];
> >
> > in plugins/gnome/intf_gnome.c to
> >       char                psz_name[256];
> > ?
> 
> Thanks, I don't think we need 256, but 10 is not enough and I noticed
> that it wasn't even initialized in one of the funtions.
> 
> I correct it.

Hi.

There is still a problem. 12 bytes is not enough. E.g.
	"Title 1 (18)"
requires 13 bytes (including the '\0').

You don't need to make the array 256 bytes, but I can't see any problem in
making it reasonably long (40 bytes?) so that we can be confident that
sprintf won't ever write past the end of the array. The memory for psz_name
is only reserved during the execution of the GnomeTitleMenu function:
There's no reason to try to save every byte you possibly can (it's better to
try to avoid seg-faults.)


Shane.




More information about the vlc-devel mailing list