[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH 3 of 3 RESEND] libxl: Warn that /usr/bin/pygrub is deprecated



George Dunlap writes ("Re: [Xen-devel] [PATCH 3 of 3 RESEND] libxl: Warn that 
/usr/bin/pygrub is deprecated"):
> On 09/05/12 14:43, Ian Campbell wrote:
> > On Wed, 2012-05-09 at 11:51 +0100, George Dunlap wrote:
> >> +    if ( !strncmp(info->u.pv.bootloader, "/usr/bin/pygrub", 20) )
> > Why strncmp and not just strcmp? And why 20? AFAIK
> > strlen("/usr/bin/pygrub") == 15 or 16 or so...
>
> ISTR in the past build processes throwing warnings that strcmp() is 
> unsafe, and since warnings turn to errors, pre-emptively used the "safe" 
> version instead.

Boggle.  Any such build processes need to be taken out and shot.
There is nothing wrong with strcmp.  Are you sure you're not thinking
of strcat or sprintf ?

>  Let me give it a try; it should be perfectly safe for 
> us, and will remove the issue with manually syncronizing string with its 
> size.

Right, yes.

Ian.

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.