trace-cmd: fix writing of uncompressed size
Sven Schnelle
reviewerPATCH v2 1/1 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.
--- lib/trace-cmd/trace-compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/trace-cmd/trace-compress.c +1 -1
@@ -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;
Signature · 1 line
2.36.1
Quoted 8 lines · Sven Schnelle
pointer in struct
tracecmd_compressionis 'unsigned long', which is 8 byte in size on most platforms, but thetep_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.Fixes 3f8447b1 ("trace-cmd library: Add support for compression algorithms")Signed-off-by Sven Schnelle <[email protected]>
Thanks!
Quoted 20 lines
--- lib/trace-cmd/trace-compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/trace-cmd/trace-compress.c +1
-2@@ -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; --2.36.1
Signature · 2 lines
Tzvetomir (Ceco) Stoyanov VMware Open Source Technology Center
Quoted 7 lines · On Mon, 11 Jul 2022 11:43:40 +0200 Sven Schnelle <[email protected]> wrote:
pointer in struct
tracecmd_compressionis 'unsigned long', which is 8 byte in size on most platforms, but thetep_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.Fixes 3f8447b1 ("trace-cmd library: Add support for compression algorithms")Signed-off-by Sven Schnelle <[email protected]>
Hi Sven,
Can you resend and Cc [email protected] so that it gets added to patchwork.
Thanks!
-- Steve
Quoted 17 lines
--- lib/trace-cmd/trace-compress.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/trace-cmd/trace-compress.c +1
-1@@ -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;
Quoted 2 lines · On Mon, 11 Jul 2022 13:51:46 -0400 Steven Rostedt <[email protected]> wrote:
Can you resend and Cc [email protected] so that it gets added to patchwork.
Actually, I'll just send it for you ;-)
-- Steve
Sven Schnelle
reviewerHi Steve,
Quoted 7 lines · Steven Rostedt
Quoted 2 lines · On Mon, 11 Jul 2022 13:51:46 -0400 Steven Rostedt <[email protected]> wrote:
Can you resend and Cc [email protected] so that it gets added to patchwork.
Actually, I'll just send it for you ;-)
Thank you! :-)