aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libctf/common
diff options
context:
space:
mode:
authorConrad Meyer <cem@FreeBSD.org>2018-03-26 21:57:44 +0000
committerConrad Meyer <cem@FreeBSD.org>2018-03-26 21:57:44 +0000
commite796cc77c586c2955b2f3940dbf4991b31e8d289 (patch)
tree944c61351708a914e6fea91842dbc8200dd3b374 /cddl/contrib/opensolaris/lib/libctf/common
parent19d0de8d6435d296e9af0b4a735e0b6a8cb36457 (diff)
downloadsrc-e796cc77c586c2955b2f3940dbf4991b31e8d289.tar.gz
src-e796cc77c586c2955b2f3940dbf4991b31e8d289.zip
libctf: Appease Coverity overrun warnings
Rather than zeroing and reading into the a smaller union member the full union size, just zero and read directly into the union. No functional change intended. Reported by: Coverity Sponsored by: Dell EMC Isilon
Notes
Notes: svn path=/head/; revision=331594
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libctf/common')
-rw-r--r--cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
index f0842c10e48e..c35b1a526d21 100644
--- a/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
+++ b/cddl/contrib/opensolaris/lib/libctf/common/ctf_lib.c
@@ -230,12 +230,12 @@ ctf_fdopen(int fd, int *errp)
bzero(&ctfsect, sizeof (ctf_sect_t));
bzero(&symsect, sizeof (ctf_sect_t));
bzero(&strsect, sizeof (ctf_sect_t));
- bzero(&hdr.ctf, sizeof (hdr));
+ bzero(&hdr, sizeof (hdr));
if (fstat64(fd, &st) == -1)
return (ctf_set_open_errno(errp, errno));
- if ((nbytes = pread64(fd, &hdr.ctf, sizeof (hdr), 0)) <= 0)
+ if ((nbytes = pread64(fd, &hdr, sizeof (hdr), 0)) <= 0)
return (ctf_set_open_errno(errp, nbytes < 0? errno : ECTF_FMT));
/*