aboutsummaryrefslogtreecommitdiff
path: root/cddl/contrib/opensolaris/lib/libctf/common
diff options
context:
space:
mode:
authorAlfonso <gfunni234@gmail.com>2021-07-24 16:52:31 +0000
committerWarner Losh <imp@FreeBSD.org>2023-02-05 04:14:14 +0000
commit70164d957eb2d1147e0b52a4b1da45f64be8af8e (patch)
treeb04b5590a79411f54893529fe16d818674826455 /cddl/contrib/opensolaris/lib/libctf/common
parent0cec5b99b3c0484925f3cc0813040c160987bd45 (diff)
downloadsrc-70164d957eb2d1147e0b52a4b1da45f64be8af8e.tar.gz
src-70164d957eb2d1147e0b52a4b1da45f64be8af8e.zip
Fix truncation when ssize_t is larger than MAX_INT
Casting to int truncates size on some platforms, resulting swab not copying all the data. Cast len to size_t to avoid right shifting a signed value: we know here it's > 0, so we can safely cast it w/o losing precision. In addition, be more careful with signedness of char pointers and temporaries. Downgrade tmp from unsigned long to unsigned char since we're only reading and writing characters. Reviewed by: imp Pull Request: https://github.com/freebsd/freebsd-src/pull/516
Diffstat (limited to 'cddl/contrib/opensolaris/lib/libctf/common')
0 files changed, 0 insertions, 0 deletions