]> git.proxmox.com Git - mirror_ubuntu-artful-kernel.git/commitdiff
perf_counter: fix off task->comm by one
authorIngo Molnar <mingo@elte.hu>
Thu, 9 Apr 2009 07:48:22 +0000 (09:48 +0200)
committerIngo Molnar <mingo@elte.hu>
Thu, 9 Apr 2009 07:48:22 +0000 (09:48 +0200)
strlen() does not include the \0.

Signed-off-by: Ingo Molnar <mingo@elte.hu>
kernel/perf_counter.c

index 321c57e3556f568bca44c3aa57767a42cf633267..b07195bbd228cf93515f1c1602cb530eed57ecae 100644 (file)
@@ -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;