[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100402112843.GI5265@bicker>
Date: Fri, 2 Apr 2010 14:28:43 +0300
From: Dan Carpenter <error27@...il.com>
To: Joerg Roedel <joerg.roedel@....com>
Cc: Ingo Molnar <mingo@...e.hu>,
FUJITA Tomonori <fujita.tomonori@....ntt.co.jp>,
Shaun Ruffell <sruffell@...ium.com>,
linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: [patch] dma-debug: off by one issue
We need to reserve the last character for the NULL terminator.
Signed-off-by: Dan Carpenter <error27@...il.com>
diff --git a/lib/dma-debug.c b/lib/dma-debug.c
index ba8b670..01e6427 100644
--- a/lib/dma-debug.c
+++ b/lib/dma-debug.c
@@ -570,7 +570,7 @@ static ssize_t filter_write(struct file *file, const char __user *userbuf,
* Now parse out the first token and use it as the name for the
* driver to filter for.
*/
- for (i = 0; i < NAME_MAX_LEN; ++i) {
+ for (i = 0; i < NAME_MAX_LEN - 1; ++i) {
current_driver_name[i] = buf[i];
if (isspace(buf[i]) || buf[i] == ' ' || buf[i] == 0)
break;
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists