diff options
author | Davi Arnaut <davi.arnaut@gmail.com> | 2006-03-24 06:18:42 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-24 10:33:31 -0500 |
commit | 96840aa00a031069a136ec4c55d0bdd09ac6d3a7 (patch) | |
tree | f93592ca47f2412aa0cce3ce4c116d1678a42239 /include/linux/string.h | |
parent | 6687a97d4041f996f725902d2990e5de6ef5cbe5 (diff) |
[PATCH] strndup_user()
This patch series creates a strndup_user() function to easy copying C strings
from userspace. Also we avoid common pitfalls like userspace modifying the
final \0 after the strlen_user().
Signed-off-by: Davi Arnaut <davi.arnaut@gmail.com>
Cc: David Howells <dhowells@redhat.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include/linux/string.h')
-rw-r--r-- | include/linux/string.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 369be3264a55..dee221429ad0 100644 --- a/include/linux/string.h +++ b/include/linux/string.h | |||
@@ -18,6 +18,8 @@ extern char * strsep(char **,const char *); | |||
18 | extern __kernel_size_t strspn(const char *,const char *); | 18 | extern __kernel_size_t strspn(const char *,const char *); |
19 | extern __kernel_size_t strcspn(const char *,const char *); | 19 | extern __kernel_size_t strcspn(const char *,const char *); |
20 | 20 | ||
21 | extern char *strndup_user(const char __user *, long); | ||
22 | |||
21 | /* | 23 | /* |
22 | * Include machine specific inline routines | 24 | * Include machine specific inline routines |
23 | */ | 25 | */ |