Skip to contentSkip to conversation

trace-cmd: Fix writing of uncompressed size

PATCH New Steven Rostedt 1 participant 1 message Jul 11, 2022 s390

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 trace-cmd: Fix writing of uncompressed size

From: Sven Schnelle <[email protected]>

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.

Fixes 3f8447b1 ("trace-cmd library: Add support for compression algorithms")
---
 lib/trace-cmd/trace-compress.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
lib/trace-cmd/trace-compress.c +1 -1
index a63295e..461de8d 100644
@@ -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