From: Oleg Nesterov Date: Tue, 26 Mar 2013 23:25:05 +0000 (+1100) Subject: argv_split-teach-it-to-handle-mutable-strings-fix-2 X-Git-Tag: next-20130404~3^2~298 X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=ad86d3d1ff3c9b8018bea08e1b84910c5a61c886;p=karo-tx-linux.git argv_split-teach-it-to-handle-mutable-strings-fix-2 Cc: Andi Kleen Signed-off-by: Andrew Morton --- diff --git a/lib/argv_split.c b/lib/argv_split.c index cac7ec49e149..e927ed0e18a8 100644 --- a/lib/argv_split.c +++ b/lib/argv_split.c @@ -63,7 +63,7 @@ char **argv_split(gfp_t gfp, const char *str, int *argcp) char **argv, **argv_ret; int argc; - argv_str = kstrndup(str, KMALLOC_MAX_SIZE, gfp); + argv_str = kstrndup(str, KMALLOC_MAX_SIZE - 1, gfp); if (!argv_str) return NULL;