]> xenbits.xensource.com Git - qemu-upstream-4.6-testing.git/commit
xenfb.c: avoid expensive loops when prod <= out_cons
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>
Wed, 6 Jan 2016 16:32:22 +0000 (16:32 +0000)
committerAnthony PERARD <anthony.perard@citrix.com>
Mon, 25 Apr 2016 10:12:57 +0000 (11:12 +0100)
commit5177ee26e9f11a4e074e64567cfd1778bdbd2997
treef1d440ad8843d617356803aa0adc60455fdd2d17
parent9869880372c8e786502ce140d50158118e29a165
xenfb.c: avoid expensive loops when prod <= out_cons

If the frontend sets out_cons to a value higher than out_prod, it will
cause xenfb_handle_events to loop about 2^32 times. Avoid that by using
better checks at the beginning of the function.

upstream-commit-id: ac0487e1d2ae811cd4d035741a109a4ecfb013f1

Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com>
Reported-by: Ling Liu <liuling-it@360.cn>
hw/display/xenfb.c