perf_event: Fix __dsos__write_buildid_table()
authorXiao Guangrong <[email protected]>
Mon, 7 Dec 2009 04:07:15 +0000 (12:07 +0800)
committerIngo Molnar <[email protected]>
Mon, 7 Dec 2009 05:26:24 +0000 (06:26 +0100)
The remain buff size is 'len - pos->long_name_len - 1', not
'len - pos->long_name_len + 1'

This bug was introduced by commit 7691b1e ("perf tools: Misc small
fixes").

Signed-off-by: Xiao Guangrong <[email protected]>
Acked-by: OGAWA Hirofumi <[email protected]>
Cc: Frederic Weisbecker <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Li Zefan <[email protected]>
LKML-Reference: <4B1C7F73[email protected]>
Signed-off-by: Ingo Molnar <[email protected]>
tools/perf/util/header.c

index 08b6759287f5e7cb9429a611a880b6fbe2991302..59a9c0b3033e12352ad0754a0f3cfcb5aaeac3c5 100644 (file)
@@ -209,7 +209,7 @@ static int __dsos__write_buildid_table(struct list_head *head, int fd)
                err = do_write(fd, pos->long_name, pos->long_name_len + 1);
                if (err < 0)
                        return err;
-               err = do_write(fd, zero_buf, len - pos->long_name_len + 1);
+               err = do_write(fd, zero_buf, len - pos->long_name_len - 1);
                if (err < 0)
                        return err;
        }