From 5ab4518ce805bbf9fc68f7f4709457485e7cfaca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= Date: Sun, 4 Oct 2026 14:23:32 +0400 Subject: [PATCH] ui/vnc-jobs: assert rect coordinates and dimensions in vnc_job_add_rect MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All callers guarantee non-negative coordinates and positive dimensions. Add an assert to document the invariant that vnc_worker_clamp_rect relies on. Reported-by: Hui Peng Signed-off-by: Marc-André Lureau Message-ID: <20261004-issue-4560-v1-18-ccbef537cbeb@redhat.com> --- ui/vnc-jobs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/ui/vnc-jobs.c b/ui/vnc-jobs.c index 90b68bf4cb..81c4fa5dbd 100644 --- a/ui/vnc-jobs.c +++ b/ui/vnc-jobs.c @@ -87,6 +87,7 @@ int vnc_job_add_rect(VncJob *job, int x, int y, int w, int h) trace_vnc_job_add_rect(job->vs, job, x, y, w, h); assert(!QTAILQ_IN_USE(job, next)); + assert(x >= 0 && y >= 0 && w > 0 && h > 0); entry->rect.x = x; entry->rect.y = y;