From 7a84317f33e325155a6d7157db815b27fb26b75f Mon Sep 17 00:00:00 2001 From: Lee Bousfield Date: Thu, 6 Mar 2025 09:54:47 -0600 Subject: [PATCH] protocols: Fix cursor shape protocol valid shape check (#9547) --- src/protocols/CursorShape.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/protocols/CursorShape.cpp b/src/protocols/CursorShape.cpp index e7eb6159..d38d5a8c 100644 --- a/src/protocols/CursorShape.cpp +++ b/src/protocols/CursorShape.cpp @@ -41,7 +41,7 @@ void CCursorShapeProtocol::createCursorShapeDevice(CWpCursorShapeManagerV1* pMgr } void CCursorShapeProtocol::onSetShape(CWpCursorShapeDeviceV1* pMgr, uint32_t serial, wpCursorShapeDeviceV1Shape shape) { - if UNLIKELY ((uint32_t)shape == 0 || (uint32_t)shape > CURSOR_SHAPE_NAMES.size()) { + if UNLIKELY ((uint32_t)shape == 0 || (uint32_t)shape >= CURSOR_SHAPE_NAMES.size()) { pMgr->error(WP_CURSOR_SHAPE_DEVICE_V1_ERROR_INVALID_SHAPE, "The shape is invalid"); return; }