From 8c5dcbbf8a9063b4f3d6a346fd871d7633f16c7d Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sun, 29 Mar 2026 14:24:17 -0700 Subject: [PATCH] fb: quiet -Wanalyzer-out-of-bounds warnings in fbOverlayCopyWindow() Reported in #1817: xwayland-24.1.6/redhat-linux-build/../fb/fboverlay.c:230:13: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read xwayland-24.1.6/redhat-linux-build/../fb/fboverlay.c:233:9: warning[-Wanalyzer-out-of-bounds]: stack-based buffer over-read Signed-off-by: Alan Coopersmith Part-of: --- fb/fboverlay.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fb/fboverlay.c b/fb/fboverlay.c index 54fd63e50..5165417f7 100644 --- a/fb/fboverlay.c +++ b/fb/fboverlay.c @@ -24,6 +24,7 @@ #include +#include #include #include "include/shmint.h" @@ -210,6 +211,7 @@ fbOverlayCopyWindow(WindowPtr pWin, xPoint ptOldOrg, RegionPtr prgnSrc) /* * Compute the portion of each fb affected by this copy */ + assert(pScrPriv->nlayers <= FB_OVERLAY_MAX); for (i = 0; i < pScrPriv->nlayers; i++) { RegionNull(&layerRgn[i]); RegionIntersect(&layerRgn[i], &rgnDst,