[tip:perfcounters/core] perf_counter: fix off task->comm by one

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Commit-ID:  888fcee066a2f4abd0d0bc9418c0535f9b01e6e5
Gitweb:     http://git.kernel.org/tip/888fcee066a2f4abd0d0bc9418c0535f9b01e6e5
Author:     Ingo Molnar <mingo@xxxxxxx>
AuthorDate: Thu, 9 Apr 2009 09:48:22 +0200
Committer:  Ingo Molnar <mingo@xxxxxxx>
CommitDate: Thu, 9 Apr 2009 09:48:22 +0200

perf_counter: fix off task->comm by one

strlen() does not include the \0.

Signed-off-by: Ingo Molnar <mingo@xxxxxxx>


---
 kernel/perf_counter.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/kernel/perf_counter.c b/kernel/perf_counter.c
index 321c57e..b07195b 100644
--- a/kernel/perf_counter.c
+++ b/kernel/perf_counter.c
@@ -1989,7 +1989,7 @@ static void perf_counter_comm_event(struct perf_comm_event *comm_event)
 	unsigned int size;
 	char *comm = comm_event->task->comm;
 
-	size = ALIGN(strlen(comm), sizeof(u64));
+	size = ALIGN(strlen(comm)+1, sizeof(u64));
 
 	comm_event->comm = comm;
 	comm_event->comm_size = size;
@@ -2109,7 +2109,7 @@ static void perf_counter_mmap_event(struct perf_mmap_event *mmap_event)
 	}
 
 got_name:
-	size = ALIGN(strlen(name), sizeof(u64));
+	size = ALIGN(strlen(name)+1, sizeof(u64));
 
 	mmap_event->file_name = name;
 	mmap_event->file_size = size;
--
To unsubscribe from this list: send the line "unsubscribe linux-tip-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Stable Commits]     [Linux Stable Kernel]     [Linux Kernel]     [Linux USB Devel]     [Linux Video &Media]     [Linux Audio Users]     [Yosemite News]     [Linux SCSI]

  Powered by Linux