aboutsummaryrefslogtreecommitdiffstats
path: root/cmd
diff options
context:
space:
mode:
authorBrooks Davis <[email protected]>2022-10-27 23:28:03 +0100
committerBrian Behlendorf <[email protected]>2022-11-03 09:52:23 -0700
commitb9041e1f27b7b29b27ac3b873c7ba2922bccca01 (patch)
tree9373e5bd74abc3b07b31f18250ff67a079d2ea58 /cmd
parent877790001e74b6c3b2955e4b7a8c685385e77654 (diff)
Use intptr_t when storing an integer in a pointer
Cast the integer type to (u)intptr_t before casting to "void *". In CHERI C/C++ we warn on bare casts from integers to pointers to catch attempts to create pointers our of thin air. We allow the warning to be supressed with a suitable cast through (u)intptr_t. Reviewed-by: Matthew Ahrens <[email protected]> Reviewed-by: Richard Yao <[email protected]> Signed-off-by: Brooks Davis <[email protected]> Closes #14131
Diffstat (limited to 'cmd')
-rw-r--r--cmd/zstream/zstream_decompress.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/cmd/zstream/zstream_decompress.c b/cmd/zstream/zstream_decompress.c
index e5527777b..6e0da0852 100644
--- a/cmd/zstream/zstream_decompress.c
+++ b/cmd/zstream/zstream_decompress.c
@@ -146,7 +146,7 @@ zstream_do_decompress(int argc, char *argv[])
p = hsearch(e, ENTER);
if (p == NULL)
errx(1, "hsearch");
- p->data = (void*)type;
+ p->data = (void*)(intptr_t)type;
}
if (isatty(STDIN_FILENO)) {