Thread (16 messages) 16 messages, 6 authors, 2011-02-11

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

From: Olaf van der Spek <hidden>
Date: 2011-02-10 11:39:22

On Thu, Feb 10, 2011 at 12:37 PM, Jeremy Sanders
[off-list ref] wrote:
Olaf van der Spek wrote:
quoted
On Thu, Feb 10, 2011 at 12:08 PM, Thomas Bellman [off-list ref]
wrote:
quoted
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
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help