From: tip-bot for Dan Carpenter <error27@gmail.com>
To: linux-tip-commits@vger.kernel.org
Cc: linux-kernel@vger.kernel.org, hpa@zytor.com, mingo@redhat.com,
rostedt@goodmis.org, error27@gmail.com, tglx@linutronix.de
Subject: [tip:perf/core] trace: strlen() return doesn't account for the NULL
Date: Fri, 23 Jul 2010 12:11:58 GMT [thread overview]
Message-ID: <tip-24a461d537f49f9da6533d83100999ea08c6c755@git.kernel.org> (raw)
In-Reply-To: <20100710100644.GV19184@bicker>
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;
}
prev parent reply other threads:[~2010-07-23 12:12 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-07-10 10:06 [patch] " Dan Carpenter
2010-07-23 12:11 ` tip-bot for Dan Carpenter [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=tip-24a461d537f49f9da6533d83100999ea08c6c755@git.kernel.org \
--to=error27@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tip-commits@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome