summaryrefslogtreecommitdiffstats
path: root/scripts/switch-timer-api
diff options
context:
space:
mode:
authorPeter Maydell2017-03-03 16:50:30 +0100
committerPeter Maydell2017-03-07 15:33:51 +0100
commit2e3883d03df167b15f2acc5345eb9a7e0150a062 (patch)
treef279b7f0eb1cea99b6a654100511b70c5938d974 /scripts/switch-timer-api
parentdisas/i386: Avoid NULL pointer dereference in error case (diff)
downloadqemu-2e3883d03df167b15f2acc5345eb9a7e0150a062.tar.gz
qemu-2e3883d03df167b15f2acc5345eb9a7e0150a062.tar.xz
qemu-2e3883d03df167b15f2acc5345eb9a7e0150a062.zip
disas/m68k: Avoid unintended sign extension in get_field()
In get_field(), we take an 'unsigned char' value and shift it left, which implicitly promotes it to 'signed int', before ORing it into an 'unsigned long' type. If 'unsigned long' is 64 bits then this will result in a sign extension and the top 32 bits of the result will be 1s. Add explicit casts to unsigned long before shifting to prevent this. (Spotted by Coverity, CID 715697.) Signed-off-by: Peter Maydell <peter.maydell@linaro.org> Reviewed-by: Laurent Vivier <laurent@vivier.eu> Message-id: 1488556233-31246-4-git-send-email-peter.maydell@linaro.org
Diffstat (limited to 'scripts/switch-timer-api')
0 files changed, 0 insertions, 0 deletions