grub-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 3/7] Initial support for U-Boot platforms


From: Vladimir 'φ-coder/phcoder' Serbinenko
Subject: Re: [PATCH 3/7] Initial support for U-Boot platforms
Date: Wed, 03 Apr 2013 21:59:32 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12

On 03.04.2013 20:05, Lennart Sorensen wrote:

> On Wed, Apr 03, 2013 at 04:24:51PM +0000, Leif Lindholm wrote:
>> Because I am an overtly paranoid person. :)
> 
> That's not paranoid.  That's just inefficient.  The length argument has
> to be based on the target size, NOT the length of the source.  If you want
> to length of the source, that's what plain old strcpy does by definition.
> 
> I just found some of those in some other code I was cleaning up and
> wasn't pleased with them there.  Just because it says strncpy doesn't
> mean what you are doing is any safer than strcpy if you do it wrong.
> 

Please use grub_strdup in this case. Also grub_stpcpy may be useful

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]