]> git.ipfire.org Git - thirdparty/libvirt.git/commit
virrandom: Avoid undefined behaviour in virRandomBits
authorMichal Privoznik <mprivozn@redhat.com>
Thu, 2 Aug 2018 07:29:38 +0000 (09:29 +0200)
committerMichal Privoznik <mprivozn@redhat.com>
Mon, 6 Aug 2018 10:42:28 +0000 (12:42 +0200)
commit0a5a6f0d019996b015bb0acbe30efa8f2fbbb351
tree86976d6c4ea2929749989f2940fdc9f5b083f2e1
parent1c701c47d50e3f26ea6662eced173dc39facbb5d
virrandom: Avoid undefined behaviour in virRandomBits

If nbits is 64 (or greater) then shifting 1ULL left is undefined.

Signed-off-by: Michal Privoznik <mprivozn@redhat.com>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
src/util/virrandom.c