All of lore.kernel.org
 help / color / mirror / Atom feed
* [patch] dma-debug: off by one issue
@ 2010-04-02 11:28 ` Dan Carpenter
  0 siblings, 0 replies; 14+ messages in thread
From: Dan Carpenter @ 2010-04-02 11:28 UTC (permalink / raw)
  To: Joerg Roedel
  Cc: Ingo Molnar, FUJITA Tomonori, Shaun Ruffell, linux-kernel,
	kernel-janitors

We need to reserve the last character for the NULL terminator.

Signed-off-by: Dan Carpenter <error27@gmail.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;

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2010-04-07 10:05 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-04-02 11:28 [patch] dma-debug: off by one issue Dan Carpenter
2010-04-02 11:28 ` Dan Carpenter
2010-04-03 20:47 ` Joerg Roedel
2010-04-03 20:47   ` Joerg Roedel
2010-04-05 12:53   ` Dan Carpenter
2010-04-05 12:53     ` Dan Carpenter
2010-04-05 14:02     ` Joerg Roedel
2010-04-05 14:02       ` Joerg Roedel
2010-04-05 14:09       ` Joerg Roedel
2010-04-05 14:09         ` Joerg Roedel
2010-04-06 16:45         ` [patch v2] dma-debug: cleanup for loop Dan Carpenter
2010-04-06 16:45           ` Dan Carpenter
2010-04-07 10:05           ` Joerg Roedel
2010-04-07 10:05             ` Joerg Roedel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.