lkml.org 
[lkml]   [2015]   [Nov]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/5] kernfs: implement kernfs_walk_and_get()
From
From: Tejun Heo <tj@kernel.org>
Date: Tue, 17 Nov 2015 14:40:37 -0500

> + static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */
> + int len = strlen(path);
...
> + if (len >= PATH_MAX)
> + return NULL;
> +
> + memcpy(path_buf, path, len + 1);

static char path_buf[PATH_MAX]; /* protected by kernfs_mutex */
int len = strlcpy(path_buf, path, PATH_MAX);
...
if (len >= PATH_MAX)
return NULL;


\
 
 \ /
  Last update: 2015-11-17 22:41    [W:0.099 / U:0.196 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site