Re: [PATCH] Btrfs-progs use safe string manipulation functions

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

 



On Thu, Feb 10, 2011 at 12:37 PM, Jeremy Sanders
<jeremy@xxxxxxxxxxxxxxxxx> wrote:
> Olaf van der Spek wrote:
>
>> On Thu, Feb 10, 2011 at 12:08 PM, Thomas Bellman <bellman@xxxxxxxxxx>
>> wrote:
>>> strncpy(args.name, source, BTRFS_PATH_NAME_MAX);
>>> args.name[BTRFS_PATH_NAME_MAX] = '\0';
>>
>> That's silly. Isn't there a sane safe variant of strcpy?
>
> There's strlcpy, but it's not in glibc because of possible truncation
> errors!

Then use a private wrapper.

-- 
Olaf
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux