On 07/20/2017 05:50 AM, Daniel P. Berrange wrote: > On Fri, Apr 07, 2017 at 03:38:47PM +0100, Dr. David Alan Gilbert wrote: >> Hi, >> Fedora 26 has gcc 7.0.1 which has the normal compliment >> of new fussy warnings; so far I've posted : >>
>> +++ b/include/qemu/iov.h >> @@ -46,7 +46,7 @@ static inline size_t >> iov_from_buf(const struct iovec *iov, unsigned int iov_cnt, >> size_t offset, const void *buf, size_t bytes) >> { >> - if (__builtin_constant_p(bytes) && iov_cnt && >> + if (__builtin_constant_p(bytes) && iov_cnt && bytes <= INT_MAX && >> offset <= iov[0].iov_len && bytes <= iov[0].iov_len - offset) { >> memcpy(iov[0].iov_base + offset, buf, bytes); >> return bytes; > Unless I've missed a patch somwhere, I think the problems that these two > chunks are fixing are still needed for current git master, to stop warnings > in the unit tests. Huh. I guess I'm not seeing warnings (aka -Werror failures) in those spots there because I typically compile with -g instead of -O2 for development. (It's annoying that the set of warnings issued by gcc depends on your optimization levels, but such is life) -- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
signature.asc
Description: OpenPGP digital signature