mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-03 15:53:54 -06:00
Fix calculation of minimum in colo_compare_tcp
GitHub's CodeQL reports a critical error which is fixed by using the MIN macro: Unsigned difference expression compared to zero Signed-off-by: Stefan Weil <sw@weilnetz.de> Cc: qemu-stable@nongnu.org Reviewed-by: Zhang Chen <chen.zhang@intel.com> Signed-off-by: Jason Wang <jasowang@redhat.com>
This commit is contained in:
parent
76240dd2a3
commit
e29bc931e1
1 changed files with 1 additions and 2 deletions
|
@ -412,8 +412,7 @@ static void colo_compare_tcp(CompareState *s, Connection *conn)
|
|||
* can ensure that the packet's payload is acknowledged by
|
||||
* primary and secondary.
|
||||
*/
|
||||
uint32_t min_ack = conn->pack - conn->sack > 0 ?
|
||||
conn->sack : conn->pack;
|
||||
uint32_t min_ack = MIN(conn->pack, conn->sack);
|
||||
|
||||
pri:
|
||||
if (g_queue_is_empty(&conn->primary_list)) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue