diff options
author | Sven Schnelle <svens@linux.ibm.com> | 2022-07-11 14:21:04 -0400 |
---|---|---|
committer | Steven Rostedt (Google) <rostedt@goodmis.org> | 2022-07-11 15:48:42 -0400 |
commit | be8c192dbbeaa685f5d3028f9c38205f362b6e14 (patch) | |
tree | 58c0e709dd1efa429d7da8b3afbe859f8db3a935 | |
parent | dac020e766dc5134147826bb0fb311ba2d01ee6d (diff) | |
download | trace-cmd-be8c192dbbeaa685f5d3028f9c38205f362b6e14.tar.gz |
trace-cmd: Fix writing of uncompressed size
pointer in struct tracecmd_compression is 'unsigned long', which is 8 byte
in size on most platforms, but the tep_read_number() call in the next line
treats it as a 4 byte value. As there's no need for unsigned long change
the type to unsigned int.
Link: https://lore.kernel.org/all/20220711074418.858843-1-svens@linux.ibm.com/
Link: https://lore.kernel.org/all/20220711094340.2829115-1-svens@linux.ibm.com/
Link: https://lore.kernel.org/linux-trace-devel/20220711142104.090b9030@gandalf.local.home
Fixes: 3f8447b1 ("trace-cmd library: Add support for compression algorithms")
Acked-by: Tzvetomir Stoyanov (VMware) <tz.stoyanov@gmail.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
-rw-r--r-- | lib/trace-cmd/trace-compress.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/trace-cmd/trace-compress.c b/lib/trace-cmd/trace-compress.c index a63295e6..461de8d0 100644 --- a/lib/trace-cmd/trace-compress.c +++ b/lib/trace-cmd/trace-compress.c @@ -32,7 +32,7 @@ struct tracecmd_compression { int fd; unsigned int capacity; unsigned int capacity_read; - unsigned long pointer; + unsigned int pointer; char *buffer; struct compress_proto *proto; struct tep_handle *tep; |