linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch] trace: strlen() return doesn't account for the NULL
@ 2010-07-10 10:06 Dan Carpenter
  2010-07-23 12:11 ` [tip:perf/core] " tip-bot for Dan Carpenter
  0 siblings, 1 reply; 2+ messages in thread
From: Dan Carpenter @ 2010-07-10 10:06 UTC (permalink / raw)
  To: Steven Rostedt
  Cc: Frederic Weisbecker, Ingo Molnar, Li Zefan, linux-kernel,
	kernel-janitors

We need to add one to the strlen() return because of the NULL
character.  The type->name here generally comes from the kernel and I
don't think any of them come close to being MAX_TRACER_SIZE (100)
characters long so this is basically a cleanup.

Signed-off-by: Dan Carpenter <error27@gmail.com>

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 086d363..5f13c35 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -729,7 +729,7 @@ __acquires(kernel_lock)
 		return -1;
 	}
 
-	if (strlen(type->name) > MAX_TRACER_SIZE) {
+	if (strlen(type->name) >= MAX_TRACER_SIZE) {
 		pr_info("Tracer has a name longer than %d\n", MAX_TRACER_SIZE);
 		return -1;
 	}

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

* [tip:perf/core] trace: strlen() return doesn't account for the NULL
  2010-07-10 10:06 [patch] trace: strlen() return doesn't account for the NULL Dan Carpenter
@ 2010-07-23 12:11 ` tip-bot for Dan Carpenter
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Dan Carpenter @ 2010-07-23 12:11 UTC (permalink / raw)
  To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, rostedt, error27, tglx

Commit-ID:  24a461d537f49f9da6533d83100999ea08c6c755
Gitweb:     http://git.kernel.org/tip/24a461d537f49f9da6533d83100999ea08c6c755
Author:     Dan Carpenter <error27@gmail.com>
AuthorDate: Sat, 10 Jul 2010 12:06:44 +0200
Committer:  Steven Rostedt <rostedt@goodmis.org>
CommitDate: Thu, 22 Jul 2010 14:56:41 -0400

trace: strlen() return doesn't account for the NULL

We need to add one to the strlen() return because of the NULL
character.  The type->name here generally comes from the kernel and I
don't think any of them come close to being MAX_TRACER_SIZE (100)
characters long so this is basically a cleanup.

Signed-off-by: Dan Carpenter <error27@gmail.com>
LKML-Reference: <20100710100644.GV19184@bicker>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
---
 kernel/trace/trace.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index f7488f4..cacb6f0 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -739,7 +739,7 @@ __acquires(kernel_lock)
 		return -1;
 	}
 
-	if (strlen(type->name) > MAX_TRACER_SIZE) {
+	if (strlen(type->name) >= MAX_TRACER_SIZE) {
 		pr_info("Tracer has a name longer than %d\n", MAX_TRACER_SIZE);
 		return -1;
 	}

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

end of thread, other threads:[~2010-07-23 12:12 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-10 10:06 [patch] trace: strlen() return doesn't account for the NULL Dan Carpenter
2010-07-23 12:11 ` [tip:perf/core] " tip-bot for Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).