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

_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

Reply via email to